diff --git a/api/__pycache__/model_api.cpython-39.pyc b/api/__pycache__/model_api.cpython-39.pyc index b21ca51..bbc408f 100644 Binary files a/api/__pycache__/model_api.cpython-39.pyc and b/api/__pycache__/model_api.cpython-39.pyc differ diff --git a/api/model_api.py b/api/model_api.py index 6e0b801..83f2bf3 100644 --- a/api/model_api.py +++ b/api/model_api.py @@ -14,7 +14,7 @@ class TrainRequest(BaseModel): algorithm: str task_type : str parameters: Dict - metrics: List[str] + # metrics: List[str] experiment_name: str class PredictRequest(BaseModel): @@ -60,7 +60,7 @@ async def train_model(request: TrainRequest): 'algorithm': request.algorithm, 'task_type': request.task_type, 'params': request.parameters, - 'metrics': request.metrics + # 'metrics': request.metrics }, experiment_name=request.experiment_name ) diff --git a/doc/安装文档.md b/doc/安装文档.md index 3cd1652..29a3099 100644 --- a/doc/安装文档.md +++ b/doc/安装文档.md @@ -61,19 +61,42 @@ GET http://10.0.0.202:8992/model/available/{model_name} GET http://10.0.0.202:8992/model/metrics ### 3.10 模型训练 -POST +POST http://10.0.0.202:8992/model/train + +{ + "train_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/breast_cancer_20250224_170615/train_breast_cancer_20250224_170615.csv", + "val_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/breast_cancer_20250224_170615/val_breast_cancer_20250224_170615.csv", + "algorithm": "XGBClassifier", + "task_type": "classification", + "parameters": { + "n_estimators": 100, + "learning_rate": 0.1, + "max_depth": 6, + "random_state": 42 + }, + "experiment_name": "test_post_1" +} ### 3.11 获取实验列表 GET http://10.0.0.202:8992/model/experiments ### 3.12 获取具体实验内容 -GET http://10.0.0.202://8992/model/experiment/{experiment_name} +GET http://10.0.0.202:8992/model/experiment/{experiment_name} ### 3.13 删除模型指定实验模型 DELETE ### 3.14 模型预测 -POST +POST http://10.0.0.202:8992/model/predict + { + "run_id": "33939ea6d8ce4d43a268f23f7361651e", + "data_path": "/home/admin-root/haotian/MLPlatform/dataset/dataset_processed/breast_cancer_20250219_145614/test_breast_cancer_20250219_145614.csv", + "output_path": "predictions/pred_breast_cancer_20250219_145614.csv", + "return_proba": true, + "metrics": [ + "accuracy", "f1", "precision", "recall" + ] + } ### 3.15 查看系统资源使用情况 GET http://10.0.0.202:8992/system/resources