feat: 将数据集从国外员工缺勤数据替换为中国企业缺勤模拟数据
- 新增中国企业员工缺勤模拟数据集生成脚本(generate_dataset.py),覆盖7个行业、180家企业、2600名员工 - 重构 config.py,更新特征字段为中文名称,调整目标列、员工ID、行业类型等配置 - 重构 clustering.py,简化聚类逻辑,更新聚类特征和群体命名(高压通勤型、健康波动型等) - 重构 feature_mining.py,更新相关性分析和群体比较维度(按行业、班次、婚姻状态等) - 新增 model_features.py 定义模型训练特征 - 更新 preprocessing.py 和 train_model.py 适配新数据结构 - 更新各 API 路由默认参数(model: random_forest, dimension: industry) - 前端更新主题样式和各视图组件适配中文字段 - 更新系统名称为 China Enterprise Absence Analysis System
This commit is contained in:
@@ -8,7 +8,7 @@ analysis_bp = Blueprint('analysis', __name__, url_prefix='/api/analysis')
|
||||
@analysis_bp.route('/importance', methods=['GET'])
|
||||
def get_importance():
|
||||
try:
|
||||
model_type = request.args.get('model', 'rf')
|
||||
model_type = request.args.get('model', 'random_forest')
|
||||
result = analysis_service.get_feature_importance(model_type)
|
||||
return jsonify({
|
||||
'code': 200,
|
||||
@@ -43,7 +43,7 @@ def get_correlation():
|
||||
@analysis_bp.route('/compare', methods=['GET'])
|
||||
def get_compare():
|
||||
try:
|
||||
dimension = request.args.get('dimension', 'drinker')
|
||||
dimension = request.args.get('dimension', 'industry')
|
||||
result = analysis_service.get_group_comparison(dimension)
|
||||
return jsonify({
|
||||
'code': 200,
|
||||
|
||||
Reference in New Issue
Block a user