借鉴Karpathy autoresearch理念的表格数据AutoML技能。AI代理自主进行ML实验,通过迭代优化模型参数和结构,在CPU环境下自动寻找最佳配置。支持7种传统ML模型、早停机制、交叉验证和集成策略。
用户请求数据建模
↓
1. 收集参数(数据路径/目标列/任务类型/指标/预算)
↓
2. 分析数据(读取prepare.py元特征,确定推荐模型和策略)
↓
3. 初始化工作区(复制脚本/数据,git init,建立baseline)
↓
4. 实验循环(修改train.py → 运行 → 评估 → keep/discard → 迭代)
↓
5. 输出最佳模型和配置报告
Ask user for:
小葱技能7w4.net持续更新中。
Run data check:
python scripts/prepare.py --check-data
This outputs: sample count, feature count, target distribution, missing values, recommended models.
For tuning strategy, read references/optimization_strategies.md when planning experiments.
python scripts/auto_research.py --data <path> --target <col> --task <type> --setup-only
This creates:
./automl_exp/
├── prepare.py # Fixed: data loading, preprocessing, metrics
├── train.py # Modifiable: model, params, feature engineering
├── data.csv # User data
├── results.tsv # Experiment log
└── .automl_cache/ # Cache + config
Then run baseline to establish reference metric.
For each round:
results.tsv — current best, recent trend, what workedtrain.py — update MODEL_NAME, MODEL_PARAMS, FEATURE_ENGINEERINGpython train.py > run.log 2>&1 with timeoutFor experiment design rules and tuning strategies, read references/program.md and references/optimization_strategies.md.
Key tuning priority (GBT models):
Do NOT ask user "should I continue?" during loop. Run autonomously until max_experiments or user stops.
Report:
| Scale | Samples | Priority Models |
|---|---|---|
| Tiny | <1K | rf, extra |
| Small | 1K-10K | gbdt, catboost |
| Medium | 10K-100K | lgb, xgb |
| Large | >100K | lgb |
Classification: accuracy, f1, f1_macro, f1_weighted, precision, recall, roc_auc Regression: rmse, mae, r2, mape
scikit-learn, pandas, numpy, xgboost, lightgbm, catboost, psutil
Install if missing:
pip install scikit-learn pandas numpy xgboost lightgbm catboost psutil
请使用automl技能优化我的客户流失预测模型:
- 数据:./customer_churn.csv
- 目标列:churn
- 任务:classification
- 指标:roc_auc
- 时间预算:180秒/轮
- 最多30轮
这个AutoML技能质量中等偏上,胜在设计规范、文档齐全、模型支持丰富。但实际自动化能力有限,更像一份详细的操作指南而非真正的自动化工具。优点是帮你把调参流程标准化了,有现成的实验管理机制;不足是很多环节仍需你手动操作,自动化程度不够高,对新手不太友好。