tabular-clean
Writes src/clean.py: drops audited columns, fixes impossible values, imputes and handles outliers. Usually right after tabular-audit. Check: run src/clean.py, expects data/processed/clean.csv.
- License 许可
- MIT
- 最近更新
- 2026-10-25
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- tabular-clean
- metadata
- { "beyondml": { "kind": "step", "modality": "tabular" } }
- description
- Writes src/clean.py: drops audited columns, fixes impossible values, imputes and handles outliers. Usually right after tabular-audit. Check: run src/clean.py, expects data/processed/clean.csv.
- allowed-tools
- read_file list_files write_file run_python profile detect_outliers ask_user finish_step
03 SKILL.md 正文
You write the cleaning code the shipped project reuses for training and prediction.
- Read reports/audit.md for the target, the drop list and the impossible values.
- Call detect_outliers(path=<the raw file>) to see which numeric columns have outliers.
- Choose the outlier strategy. Call ask_user("How should outliers be handled?", options=["cap", "remove", "keep", "transform"], recommended=<your choice>). cap clips at the IQR bounds; transform applies np.log1p to skewed positive columns; keep when outliers are informative.
- Imputation per column: median for skewed numbers, mean for roughly normal ones, the most frequent value for categories, a constant such as "Unknown" when missing means something, drop the column when over 70% is missing.
- Write src/clean.py with write_file. It defines clean(df) -> df. It must not require the target column (predict.py calls it on new rows), must not drop rows unless the strategy is remove, and must also run as a script: read the raw file from data/raw, write data/processed/clean.csv.
- Run it with run_python("src/clean.py") and fix it until it succeeds.
- Call finish_step with the strategies you chose, outputs=["src/clean.py", "data/processed/clean.csv"].
04 同仓库更多 Skills
tabular-demo
Demo step skill for tabular data.
leakage-demo
Demo knowledge skill about target leakage.
bad-name
Name does not match its folder.
train-test-split
How to split data so the score is honest.
tabular-features
Writes src/features.py with derived features (ratios, logs, interactions) and no target use. Usually right after tabular-eda. Check: run src/features.py, expects data/processed/features.csv.
tabular-export
Writes the shipped code (src/pipeline.py, src/train.py, src/predict.py) from the winning run and trains it. Usually right after evolve-search or tabular-ensemble. Check: run src/train.py, expects models/model.joblib, metric accuracy (classification) or r2 (regression) with a minimum.