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.
