Exploratory Data Analysis in Python: A Repeatable Checklist
An 8-step EDA checklist as one Python function: planted 13 problems in a messy table, caught 11 first run — pandas 3 dtype trap and a threshold mismatch.
Dimensionality Reduction for Feature Engineering: PCA vs t-SNE vs UMAP
PCA, t-SNE, and UMAP compared on scikit-learn digits: PCA ties raw pixels in a pipeline, t-SNE scores 0.983 trustworthiness — but can't embed new rows.
Train-Test Split Done Right: Stratified, Time-Based, and Group Splits
Random train_test_split left test sets with no positives 1 time in 9, scores from 0.912 to 1.000 — stratified, time-based, and group splits fix each failure.
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.