Feature Engineering Toolkit Skill for Leakage-Safe Encoding
Build a scikit-learn preprocessing pipeline that scales numeric inputs and handles unseen categories using transforms fitted on training data.
中文Install in Claude Code
Use Python, pandas, scikit-learn, and synthetic products with quantity and category features.
- Get the complete `plugins/ai-ml/feature-engineering-toolkit/skills/engineering-features-for-machine-learning` directory from the pinned GitHub commit.
- Copy it into the target project's `.claude/skills/`. Check `.claude/skills/engineering-features-for-machine-learning/SKILL.md`, start Claude Code at the project root, and call `/engineering-features-for-machine-learning`.
Example task
Train on mug and cup, then include bottle in a held-out row. Use StandardScaler and OneHotEncoder(handle_unknown='ignore') in a ColumnTransformer, and transform the holdout afterward.What to check
Holdout and training matrices have the same columns. The unknown category follows the configured policy, and scaling uses training statistics.
Original SKILL.md on GitHub · Updated
Frequently asked question
Can I fit scaling on all rows before splitting?
Split first. Fit encoders and scalers on training data, then transform validation and test rows.