Data Leakage in Machine Learning: How to Spot and Prevent It
Five leaky ML setups measured on synthetic data: feature selection on all rows hits 0.837 on pure noise, a post-outcome column hits 0.953 AUC — and the fixes.
Polynomial Features and Interaction Terms in Python
PolynomialFeatures and interaction terms let linear models fit curves and conditional effects: tuning degrees, taming the explosion, and when splines win.
Feature Engineering for Text Data: Bag of Words and TF-IDF
Bag of Words and TF-IDF explained with scikit-learn: CountVectorizer and TfidfVectorizer tuned, a full newsgroups classifier, and where lexical features fail.
Feature Engineering for Dates and Times in Python
Hour, holiday, and cyclical features tested on synthetic demand: raw hour costs 16 points of R², and shuffled CV flatters forecasts; rolling means leak.
Binning and Discretization: When to Turn Numbers into Categories
Uniform, quantile, or k-means binning tested against raw numbers: a median split costs 36% of your signal, and bins bend a linear model. Here's when it helps.
Handling Skewed Data: Log, Box-Cox, and Yeo-Johnson Transforms
Log, Box-Cox, or Yeo-Johnson on data with known shape: which transform kills skew — and the 21% error hiding in back-transformed predictions you ship.
Feature Selection Methods: Filter, Wrapper, and Embedded Explained
Filter, wrapper, and embedded feature selection tested on synthetic data: any selection beat all 100 features, and one leaky mistake faked 83% accuracy.
Outlier Detection and Removal in Python: IQR, Z-Score, and Isolation Forest
Z-score vs IQR vs Isolation Forest on data where the bad points are known: which detector holds up as contamination rises, and when removal hurts your model.
Encoding Categorical Variables: One-Hot, Label, and Target Encoding
One-hot vs label vs target encoding tested on synthetic data: integer codes broke the linear model, one-hot won, and target encoding's win was narrow.
Feature Scaling Explained: StandardScaler vs MinMaxScaler vs RobustScaler
StandardScaler, MinMaxScaler, or RobustScaler? An experiment on wine data with outliers shows which scaler wins — and when trees should skip scaling.
How to Handle Missing Data in Python: Imputation Methods Compared
Four imputers, four missing-data mechanisms, one scikit-learn experiment: mean, KNN, iterative, and indicator columns compared on error, bias, and AUC.
Best Feature Engineering Books and Courses
Best feature engineering books and courses compared: Zheng & Casari, Galli's Cookbook, Train in Data, Kaggle Learn, and the free scikit-learn documentation.