Repository navigation
feat: add missing value imputer - #10
Conversation
|
Hi @Venius24, sorry for the silence. That was our mistake: CI for first-time contributors needs a maintainer to approve it, we missed that, so no checks ran and nobody reviewed your PR. Your implementation looks solid (all 41 tests pass on our side). If you're still interested, we'd like to reopen it and merge after a few small changes:
|
# Conflicts: # src/preprocessing_toolkit/__init__.py
… ties - Nullable boolean columns now always use the most frequent value; mean and median gave 0.5, which is not a boolean. - Mode ties on object columns mixing types (e.g. "a" and 1) fell over in min(); fall back to ordering by str when values are not comparable, so numeric ties still pick the smallest number. - GridSearchCV test passes error_score="raise" so a failing fit cannot pass silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @akifkulll, no worries, and thanks for the careful review. Yes, I'd like to finish this. The branch is updated, so please reopen:
I also merged the current Locally: 69 tests pass, |
|
Reopened, and thank you for coming back to this. I checked the branch locally: all 69 tests pass and ruff is clean. The boolean, mixed-type and GridSearchCV fixes all work as described, and thanks for merging main so both blocks are exported. You're also right about key=str: comparing "10" and "9" as strings would pick the wrong numeric value, so trying plain min first is the better design. Good catch, and thanks for explaining the reasoning. It was a pleasure working with you on this. PreToolkit will keep growing after v0.1, with new blocks and features in the next versions, and we'd be glad to have you on board again. Feel free to pick up any future issue that interests you, or to open your own ideas. |
Summary
MissingValueImputeras aBasePreprocessorwith mean, median and most-frequent strategies. Non-numeric columns use the most frequent value; ties choose the smallest value.fit, preserve the input DataFrame, support nullable integer columns with fractional means, and export the class from the package.Closes #2.
Validation
ruff check .passed.ruff format --check .passed.pytest -q: 41 passed.git diff --checkpassed.