Definition
Feature hashing, also known as the hashing trick, allows machine learning models to handle large, sparse feature spaces without maintaining an explicit mapping between features and indices. By applying a hash function to each feature, it deterministically assigns them to a fixed number of buckets. This reduces memory usage and eliminates the need for preprocessing steps like vocabulary building, making it highly efficient for text classification and recommendation systems with massive input dimensions.
Summary
A technique that maps high-dimensional sparse features to a fixed-size vector using a hash function.
Key Concepts
- Hash function
- Sparse vectors
- Dimensionality reduction
- Memory efficiency
Use Cases
- Text classification with large vocabularies
- Recommendation systems with huge item sets
- Real-time streaming data processing
Code Example
| |