Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where categorical features created by interaction caused Training step 3 to crash #111

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

riley-harper
Copy link
Contributor

Fixes #110.

We caught this bug because we set strict=True in the call to zip(). Hooray!

The user names these features in the config file. So they probably don't end in _onehotencoded like other categorical variables. To determine if a variable is categorical, we now check if its data type is "vector". If so, then we strip any _onehotencoded suffix off of it and explode it for training_feature_importances. This handles both normal and interacted categorical variables nicely.

…ficients bug

This bug is triggered when a categorical feature is interacted with another feature.
The resulting feature is also categorical, but its name may not end with _onehotencoded
because the user can specify its name in the config file. So we can't rely on
column names ending with _onehotencoded to specify which features are categorical.
…g step 3 to crash

These features are categorical but may not end with the suffix "_onehotencoded". We now
check the data type of the columns in training_features_prepped and take any column with
type "vector" to be categorical and explode it. This seems pretty robust.

I also improved the test for this bug a bit.
@riley-harper riley-harper merged commit 51679a4 into main Oct 26, 2023
4 checks passed
@riley-harper riley-harper deleted the categorical_interaction_coefficients branch October 26, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Handle interacted features correctly in Training step 3
1 participant