feature-engineering

Design ML features with encoding, scaling, selection, and validation pipelines.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill feature-engineering-kalilurrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-engineering
Source: https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts/tree/main/04-ai-ml/feature-engineering
Command: npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill feature-engineering-kalilurrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw data rarely works directly in machine learning models. This Skill guides the transformation of raw numeric, categorical, text, and datetime data into engineered features that improve model performance while preventing data leakage. ## Core Features & Use Cases - Encoding & Scaling: Apply one-hot, label, target, and frequency encoding for categoricals, plus StandardScaler, MinMaxScaler, and RobustScaler for numerics. - Feature Creation & Selection: Build datetime, aggregation, interaction, and domain-specific features (RFM, credit risk ratios, lag features), then select with correlation filters, mutual information, and model-based importances. - Leakage-Safe Pipelines: Construct sklearn Pipeline and ColumnTransformer workflows with imputation, plus validation strategies like TimeSeriesSplit and feature drift monitoring. - Use Case: For a customer churn prediction task, generate 30 engineered features from 15 raw columns, select the top 25 via Random Forest importances, and package everything in a reproducible pipeline. ## Quick Start Ask the AI to design a feature engineering pipeline for your dataset by specifying the data types, model type, and target variable.

Frequently Asked Questions about feature-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I encode categorical features for machine learning?

Use one-hot encoding for nominal categories via pd.get_dummies or OneHotEncoder, label encoding for ordinal data, and target or frequency encoding for high-cardinality columns. Choose based on whether categories have inherent order and how many unique values exist.

How to prevent data leakage in feature engineering?

Split data into train and test sets before any feature engineering, then fit scalers and encoders only on training data. For time series, use TimeSeriesSplit and never compute features with future information such as shift(-1).

StandardScaler vs MinMaxScaler vs RobustScaler, which should I use?

StandardScaler centers data to mean 0 and std 1, suiting normally distributed features. MinMaxScaler scales to [0, 1] for bounded ranges, while RobustScaler uses median and IQR, making it the choice when outliers are present.

How do I select the most important features for my model?

Train a RandomForestClassifier and rank features by feature_importances_, or use SelectKBest with f_classif or mutual_info_classif for univariate selection. Also drop features with correlation above 0.95 to reduce multicollinearity.

Why should I use sklearn Pipeline for feature engineering?

Pipelines combine imputation, scaling, and encoding into one reproducible object via ColumnTransformer, ensuring identical transformations in training and production. This prevents inconsistencies and makes the workflow easy to deploy and validate.

How do I detect feature drift in production?

Compare training and production feature distributions using the Kolmogorov-Smirnov test (ks_2samp from scipy). A p-value below 0.05 indicates the distribution has shifted, signaling potential model degradation that needs investigation.