Skip to content

FEA Implement categorical feature support to IterativeImputer #31479

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vasco-s-pereira
Copy link
Contributor

@vasco-s-pereira vasco-s-pereira commented Jun 4, 2025

Fixes #31219

Our implementation automatically detects categorical columns
(based on dtype), uses a RandomForestClassifier to model and predict missing category labels, and then inverse-transforms those predictions back into the original categories. So, if given a certain X data, where X features are numerical and categorical, respectively, and there are values missing (nan) in the categorical one, _iterative.py, through the Random Forest Classifier, will predict those missing values and replace them in the data.
Co-authored-by: Fabioprata23 fabio.prata@tecnico.ulisboa.pt

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Any other comments?

…e support

 Our implementation automatically detects categorical columns
(based on dtype), uses a RandomForestClassifier to model
and predict missing category labels, and then inverse-transforms
those predictions back into the original categories. So, if given
a certain X data, where X features are numerical and categorical,
respectively, and there are values missing (nan) in the categorical
one, _iterative.py, through the Random Forest Classifier, will
predict those missing values and replace them in the data.
Co-authored-by: Fabioprata23 <fabio.prata@tecnico.ulisboa.pt>
Copy link

github-actions bot commented Jun 4, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 1f8b3a7. Link to the linter CI: here

@betatim betatim changed the title Fixes #31219: Implement missing categorical values feature support FEA Implement missing categorical values feature support Jun 4, 2025
@betatim betatim changed the title FEA Implement missing categorical values feature support FEA Implement categorical feature support to IterativeImputer Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Categorical Feature Support to IterativeImputer
1 participant