From 0310f248403a02fb9ee93c77f2593626459fa997 Mon Sep 17 00:00:00 2001 From: haotian <2421912570@qq.com> Date: Thu, 10 Apr 2025 10:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9--=E4=BF=AE=E6=94=B9=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/典型示例新版.md | 2 +- doc/接口文档code.md | 80 ++++++++++++++++++++++++++++++--------------- 2 files changed, 55 insertions(+), 27 deletions(-) diff --git a/doc/典型示例新版.md b/doc/典型示例新版.md index bd6dbba..b512d97 100644 --- a/doc/典型示例新版.md +++ b/doc/典型示例新版.md @@ -107,7 +107,7 @@ NASA Turbofan Engine Degradation Simulation数据集(通常称为C-MAPSS数据 - 超过55%的变异性未被模型捕获,说明初始模型拟合效果不佳 **参数优化**: -使用GridSearchCV进行超参数调优,探索以下参数组合(共1296种组合): +RandomForestRegressor使用GridSearchCV进行超参数调优,探索以下参数组合(共1296种组合): | 参数名称 | 可选值 | |----------|--------| diff --git a/doc/接口文档code.md b/doc/接口文档code.md index a0798ab..2b9a739 100644 --- a/doc/接口文档code.md +++ b/doc/接口文档code.md @@ -136,6 +136,13 @@ Request: "input_path": "dataset/dataset_raw/train_FD001.csv", "output_dir": "dataset/dataset_processed/", "process_methods": [ + { + "method_name": "IsolationForest", + "params": { + "n_estimators": 100, + "max_samples": "auto" + } + }, { "method_name": "StandardScaler", "params": { @@ -144,12 +151,10 @@ Request: } } ], - "feature_methods":[ - ], + "feature_methods": [], "split_params": { - "train_size": 0.7, - "val_size": 0.3 - + "train_size": 0.8, + "val_size": 0.2 } } @@ -467,14 +472,14 @@ Content-Type: application/json Request: { - "train_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/train_FD001_20250407_174421/train_train_FD001_20250407_174421.csv", - "val_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/train_FD001_20250407_174421/val_train_FD001_20250407_174421.csv", - "algorithm": "RandomForestRegressor", - "task_type": "regression", + "train_path": "dataset/dataset_processed/tpb_20250409_174922/train_tpb_20250409_174922.csv", + "val_path": "dataset/dataset_processed/tpb_20250409_174922/val_tpb_20250409_174922.csv", + "algorithm": "MLPClassifier", + "task_type": "classification", "parameters": { }, - "experiment_name": "test_FD001_1" + "experiment_name": "test_tpb_1" } Response: @@ -731,29 +736,52 @@ Content-Type: application/json Request: { - run_id": "bd3697dc238c4d1587e0f4f319d04448", + "data_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/train_FD001_20250409_105906", + "output_dir": null, + "experiment_name": "test_FDD001_1", "method": "GridSearchCV", "parameters": { - "max_depth": [3, 5, 7], - "n_estimators": [50, 100, 200], - "min_samples_split": [2, 5, 10] + "param_grid": { //一定要加参数网格 + "n_estimators": [ + 50, + 100, + 200 + ], + "max_depth": [ + null, + 10, + 20, + 30 + ] + + }, + "scoring": "r2" // 评价指标,不同任务选择不同指标. }, - "data_path": "dataset/dataset_processed/test_optimize/train.csv", - "output_dir": None, - "experiment_name": "测试模型优化方法" + "run_id": "ef413c6fd25f4042a793d4c452af3e1b" } Response: { - "status": "success", - "optimization": { - - "status": "success", - "message": "优化任务已执行", - "run_id": "903ab190690e496aa74e6aaefac8a7cb", # 新的运行id - "optimized_model_id": "bd3697dc238c4d1587e0f4f319d04448" # 被优化模型的运行id - - } + "status": "success", + "message": "优化任务已执行", + "optimization": { + "id": "opt_20250410_cbc1d9", + "run_id": "2c9d4363e55b4530a6881633ade5f4e3", + "experiment_id": "670583721104894053", + "task_id": "opt_20250410_cbc1d9", + "method": "GridSearchCV", + "original_model": "regression", + "best_params": { //最佳参数 + "max_depth": 10, + "n_estimators": 200 + }, + "best_score": 0.4481105476031095, + "cv_results_file": "optimized_models/opt_20250410_cbc1d9/cv_results.csv", + "optimized_model_id": "ef413c6fd25f4042a793d4c452af3e1b", + "execution_time": "0:01:51.399587", + "status": "completed", + "timestamp": "2025-04-10T10:20:09.709085" + } } Error Response: