Target Encoding with Smoothing & Why Leakage Happens (Train/Test Split)
This lesson is part of the course
In this lesson
You encode loan purpose by its default rate three ways: naive on all rows (leaky), on the training rows only, and smoothed towards the prior, and you see why only the last one is safe for unseen and rare categories.
Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.
Lessons in this course
- Missing Values: Data Types, Missing Flags & Mean, Median and Group Imputation Locked
- Encoding Categories: One-Hot Dummies, Count Encoding & Ordinal Ranks Locked
- Scaling: Min-Max, z-Score & Robust Scaling with Quartiles Locked
- Binning & Quantile Buckets: Tenure Bands, Income Quartiles & Default Rates (with a Chart) Locked
- Log Transforms & Outlier Capping (Winsorising at the 5th/95th Percentile) Locked
- Ratio & Interaction Features: Loan-to-Income, DTI and LTI × Self-Employed Locked
- Target Encoding with Smoothing & Why Leakage Happens (Train/Test Split) Locked
- Feature Importance Screen: Correlation with the Target & a Univariate AUC (with a Chart) Locked