alteryx / alteryx/evalml

Smarter values of top_n for One Hot Encoder in AutoML

Open
#1,893 1 comment 0 reactions 1 assignee Claimed by @asniyaz View on GitHub
enhancement needs design
Dominant language
Python
Stars
850
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Currently, `AutoMLSearch` will only fit `OneHotEncoder`s with `top_n` [set to 10](https://github.com/alteryx/evalml/blob/main/evalml/pipelines/components/transformers/encoders/onehot_encoder.py#L25).

This can be problematic because a user can have data with more than 10 categories, e.g. 50 US states, and the 40 least frequent states in the data get lumped together.

We currently have two workarounds for this:

1. Pass in a `pipeline_parameters` argument to `AutoML` where the value of `top_n` is set by the user. This may not be the best because this value of `top_n` would be applied for all categorical features.
2. User can create a DAG with multiple OHE (one for each categorical feature) where `top_n` varies for each OHE.

Ideally, `AutoMLSearch` would set a smart value of `top_n` for each categorical feature automatically that the user could then change depending on their domain knowledge.

This is closely related to #1728 but I feel it's a separate as it relates specifically to `top_n` in the OHE.

Maybe it makes sense to mark this as blocked by #1728.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.