What is feature hashing and why is it used?

Updated May 16, 2026

Short answer

Feature hashing maps high-cardinality categorical features into a fixed-size vector using a hash function.

Deep explanation

Feature hashing is used to handle large-scale categorical data efficiently. Instead of storing a mapping for each category, a hash function assigns categories to fixed indices in a vector space. This reduces memory usage but introduces collisions.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Feature Engineering interview questions

View all →