fit_transform ≠ fit().transform()for every supervised encoder — train uses the first, test the second
import as cepip install category_encoders · import category_encoders as ce
cols=None is a traponly encodes object/category dtypes — int-coded IDs pass through untouched
OneHot = k colsBinary = ⌈log₂k⌉ · Hashing = fixed · every supervised encoder = 1
BaseN generalisesbase=1 is OneHot · base=2 is Binary
Ordinal → trees onlya linear model reads Paris=3 as 3× Tokyo=1
contrast coders → linear onlyHelmert/Sum/BackDiff/Poly are pointless unless you read the coefficients
λ = 0.5 at min_samples_leafTargetEncoder's sigmoid midpoint · higher smoothing = flatter = more shrinkage
MEstimate = simpler Target(Σy + m·prior) / (n + m) — one knob, easier to tune
SHUFFLE before CatBoostit's time-aware by design — sorted rows give a biased running mean
only LOO needs NestedCVTarget/CatBoost/MEstimate already regularise internally
WOE is binary-onlymulticlass? wrap it in PolynomialWrapper
set_output("pandas")required for clean ColumnTransformer interop — the library thinks in DataFrames
Pipeline solves leakageit calls fit_transform on the train fold and transform on the val fold, free
CountEncoder is underratedleak-free, one column, strong with GBMs — try it before target encoding
check your model firstLightGBM/CatBoost/HistGBM handle categoricals natively, often better