Problem bank
Problem 162 of 333HardStatisticsP162
Encoding high-cardinality categoricals without leakage
You want to use 'ticker symbol' as a feature in a cross-sectional returns model. There are 3000 tickers and you don't want to one-hot encode. You consider target encoding: replace ticker with the mean return of that ticker historically. What's the danger and how do you fix it?
Check your answer and see the solution with a free account
Every problem on Quant Engine is free, with a hint and a full worked solution. Making an account takes 30 seconds and no card. Then you can write and check your answers, see the solutions, and track what you have solved.