Skip to content

Add support for bools in SimpleImputer - #31730

Open
ritvi-alagusankar wants to merge 12 commits into
scikit-learn:mainfrom
ritvi-alagusankar:feat-support-bool-simple-imputer
Open

ritvi-alagusankar wants to merge 12 commits into
scikit-learn:mainfrom
ritvi-alagusankar:feat-support-bool-simple-imputer

Conversation

@ritvi-alagusankar

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #26292

Changes in PR:

  • Added support for boolean data in SimpleImputer for NumPy arrays and pandas DataFrames. Updated _validate_input to recognize boolean dtypes and set dtype to bool.
  • Added relevant test cases which verifies correct imputation and output dtype across different strategies

@github-actions

github-actions Bot commented Jul 9, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

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

Generated for commit: c963c81. Link to the linter CI: here

@ritvi-alagusankar
ritvi-alagusankar marked this pull request as draft July 9, 2025 11:57
@ritvi-alagusankar
ritvi-alagusankar marked this pull request as ready for review July 9, 2025 12:12

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please parametrise the dataframe tests and make sure things work as well for polars?

@Charlie-XIAO I wonder if there's a cleaner way to implement this?

@github-actions github-actions Bot added the CI:Linter failure The linter CI is failing on this PR label Mar 28, 2026
@github-actions github-actions Bot removed the CI:Linter failure The linter CI is failing on this PR label Mar 28, 2026
@ritvi-alagusankar

ritvi-alagusankar commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Could you please parametrise the dataframe tests and make sure things work as well for polars?

@Charlie-XIAO I wonder if there's a cleaner way to implement this?

@adrinjalali @lorentzenchr I have updated dataframe tests and made it compatible with polars too, could you help take a look, thanks

This branch has not been deployed

No deployments
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 support for bools in SimpleImputer

2 participants