We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the sample code below, a column is removed from the dataset during the pipeline
>>> from sklearn.impute import SimpleImputer >>> import numpy as np >>> imp = SimpleImputer() >>> imp.fit([[0, np.nan], [1, np.nan]]) >>> imp.transform([[0, np.nan], [1, 1]]) array([[0.], [1.]])
Currently sklearn.impute.SimpleImputer silently removes features that are np.nan on every training sample.
sklearn.impute.SimpleImputer
np.nan
Therefore
fklearn/src/fklearn/training/imputation.py
Line 43 in 06475b6
new_data.shape[1] != len(columns_to_impute)
For the problematic features, either keep their values if valid or impute a default value during transform.
transform
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code sample
In the sample code below, a column is removed from the dataset during the pipeline
Problem description
Currently
sklearn.impute.SimpleImputer
silently removes features that arenp.nan
on every training sample.Therefore
fklearn/src/fklearn/training/imputation.py
Line 43 in 06475b6
new_data.shape[1] != len(columns_to_impute)
.Possible solutions
For the problematic features, either keep their values if valid or impute a default value during
transform
.The text was updated successfully, but these errors were encountered: