3.4 KiB
运行说明
1. 启动mlflow
- mlflow server --host 10.0.0.202 --port 5000
- 这里host要和config/config.yaml中配置的host一致, 不然连接不上
2. 运行 main.py
- python main.py
- 运行ip和端口在config/config.yaml中配置
- 当前python环境名为trt
- 在ip:port/docs可以看到可视化接口文档
3. 安装python环境
- 使用conda创建一个新的python环境
- pip 换源 清华源
-- pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- pip install -r requirements.txt
4. 测试接口
注: 10.0.0.202为当前本机ip
GET http://10.0.0.202:8992/health
4.1 获取数据预处理方法列表
GET http://10.0.0.202:8992/data/preprocessing/methods
4.2 获取预处理方法详情
GET http://10.0.0.202:8992/data/preprocessing/method/{method_name}
4.3 获取特征工程方法列表
GET http://10.0.0.202:8992/data/feature/methods
4.4 获取特征工程方法详情
GET http://10.0.0.202:8992/data/feature/method/{method_name}
4.5 处理数据集
POST http://10.0.0.202:8992/data/process
传递参数 { "input_path": "dataset/dataset_raw/breast_cancer.csv", "output_dir": "dataset/dataset_processed", "process_methods": [ { "method_name": "IsolationForest", "params": { "contamination": 0.1, "random_state": 42 } } ], "feature_methods": [
],
"split_params": {
"test_size": 0.1,
"val_size": 0.2
}
}
4.6 获取可用数据集列表
GET http://10.0.0.202:8992/data/datasets
4.7 获取可用模型列表
GET http://10.0.0.202:8992/model/available
4.8 获取模型详情
GET http://10.0.0.202:8992/model/available/{model_name}
4.9 获取评价指标列表
GET http://10.0.0.202:8992/model/metrics
4.10 模型训练
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" }
4.11 获取实验列表
GET http://10.0.0.202:8992/model/experiments
4.12 获取具体实验内容
GET http://10.0.0.202:8992/model/experiment/{experiment_name}
4.13 删除模型指定实验模型
DELETE
4.14 模型预测
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" ] }
4.15 查看系统资源使用情况
GET http://10.0.0.202:8992/system/resources
4.16 查看训练历史
GET http://10.0.0.202:8992/system/history
4.17 查看系统训练日志
GET http://10.0.0.202:8992/system/logs
5. 前端界面
- 暂未完成