Feature Cross
Combines multiple features to represent interaction effects explicitly
Intent & Description
π― Intent
Enable simpler or linear models to learn interaction effects between features by explicitly creating combined features that represent joint occurrences.
π Context
Linear models cannot natively learn that the combination of weekday and raining matters more for traffic than either feature alone. Deep models can learn interactions but may converge faster with explicit interaction signals.
π‘ Solution
Combine two or more features into a single new feature representing their joint occurrence. Continuous features are bucketed first so they can be crossed cleanly. The crossed feature turns a nonlinear relationship into a linear one over the crossed feature. If the resulting space is large, combine with hashing to bound its size.
Real-world Use Case
- Time-of-day and day-of-week crosses for traffic prediction
- User demographics and content category crosses for recommendations
- Geographic and seasonal crosses for demand forecasting
- Any domain where feature interactions are known to matter
Source
π TL;DR
Explicitly combine features to represent interaction effects, enabling simpler models to capture nonlinear relationships
Advantages
- Enables linear models to capture interaction effects
- Can help deep models converge faster
- Makes feature interactions explicit and interpretable
- Turns nonlinear relationships into linear ones
Disadvantages
- Combinatorial growth in feature space
- Risk of overfitting to rare, specific combinations
- Adds complexity and requires careful feature selection
- May need hashing to control size for high-cardinality crosses