Problem
A recommender at Just Eat Takeaway.com picks restaurants for a horizontal carousel from a long list of features. Over time the list grew into a "feature explosion": legacy and market-specific features piled up, and some are highly correlated. Each feature has its own data pipeline, so every extra feature adds complexity and maintenance cost. Dropping features can also improve model quality. The catch is the search space: choosing 30 of 100 features gives 2.94e+25 combinations, far too many to train and test.
Example from the article: the team found a reduced feature set whose fitness was similar to that of the full set, although 2.94e+25 combinations were possible.
Solution in brief
Treat each candidate feature subset as an individual in a genetic algorithm. Score subsets with the model's own metric (AUC), pick parents by roulette wheel, cross them in the middle, add random newcomers, and repeat for a fixed number of generations. The best subset seen in any generation is the answer.
Questions this case answers
- How to select a compact feature subset of a fixed size when the number of possible subsets is too large to train and test one by one
- How to evaluate feature interactions for removal when correlated features make single-feature attribution unreliable
- How to cut a recommender's feature list from 100 features to 30 when testing every combination is impossible?
- How to find which features can be dropped when many of them are correlated and per-feature importance misleads?
Tools and methods
- Genetic algorithm — searches feature subsets by selection, crossover and mutation instead of enumerating them
- Roulette wheel selection — picks parents with probability proportional to fitness, so weaker subsets still have a chance
- AUC — fitness metric in the article's example; replace it with your own business metric
- pandas, NumPy — hold the evaluated population and draw weighted random samples
Google or a one-time email code. No password.