High-cardinality categories (city, product id) are too many for one-hot encoding. Target encoding replaces each category with the average target value for that category, but categories with few examples are noisy, so we smooth towards the global mean:
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial