liveBook · Manning

Smoothing parameter

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A smoothing parameter controls the blending of category-specific target statistics with an overall target statistic.

A smoothing parameter controls how target encoding blends a category’s target statistic with the overall target statistic. Higher smoothing reduces the influence of categories with few observations and helps limit overfitting. section 6.1.3

Use a positive value with category_encoders.TargetEncoder. The best value depends on the data and is found through experimentation; the James Steiner encoder offers an alternative that estimates smoothing from conditional variance. section 6.1.3

High-cardinality location features

A neighborhood feature with 221 values and a latitude–longitude grid with 2,259 values can be target-encoded in a model pipeline. The example uses smoothing=0.5 alongside one-hot encoding for low-cardinality categories and XGBoost.

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines posterior–prior blending and parameter experimentation but does not derive the weighting formula.
Examples
Uses neighborhood and gridded latitude–longitude features, configured with smoothing=0.5 in a machine-learning pipeline.
What it assumes
Assumes target encoding and posterior–prior statistics while requiring no advanced mathematical derivation.
What you can do after
Apply it through category_encoders.TargetEncoder and compare smoothing values during model experimentation.
How it connects
Connects target encoding with posterior probability, prior probability, and the James Steiner encoder.

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.