-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG] BUG: add support for non numeric values in MissingIndicator #13046
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
Changes from all commits
1176d66
00d7cb5
21eff01
42d5b36
507ed3a
eb4765c
d4e7778
7fb7599
ec0ab84
3721a61
f38c8d1
4078baa
a0a99d8
e92eb1f
dd73bab
de9630f
1d8c534
f483247
42ed142
9445eb1
a95b08e
193ed4e
85fe5f6
0b5a96d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,10 +74,10 @@ | |
'OrthogonalMatchingPursuit', 'PLSCanonical', 'PLSRegression', | ||
'RANSACRegressor', 'RadiusNeighborsRegressor', | ||
'RandomForestRegressor', 'Ridge', 'RidgeCV'] | ||
|
||
ALLOW_NAN = ['Imputer', 'SimpleImputer', 'MissingIndicator', | ||
'MaxAbsScaler', 'MinMaxScaler', 'RobustScaler', 'StandardScaler', | ||
'PowerTransformer', 'QuantileTransformer'] | ||
SUPPORT_STRING = ['SimpleImputer', 'MissingIndicator'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. surely OneHotEncoder, OrdinalEncoder and meta-estimators will belong here too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do that in another PR. I think that we should also factorize the input validation as well. It is quite redundant and we could have a common test then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it probably belongs in estimator tags... (perhaps post-#8022) |
||
|
||
|
||
def _yield_non_meta_checks(name, estimator): | ||
|
@@ -625,9 +625,16 @@ def check_dtype_object(name, estimator_orig): | |
if "Unknown label type" not in str(e): | ||
raise | ||
|
||
X[0, 0] = {'foo': 'bar'} | ||
msg = "argument must be a string or a number" | ||
assert_raises_regex(TypeError, msg, estimator.fit, X, y) | ||
if name not in SUPPORT_STRING: | ||
X[0, 0] = {'foo': 'bar'} | ||
msg = "argument must be a string or a number" | ||
assert_raises_regex(TypeError, msg, estimator.fit, X, y) | ||
else: | ||
# Estimators supporting string will not call np.asarray to convert the | ||
# data to numeric and therefore, the error will not be raised. | ||
# Checking for each element dtype in the input array will be costly. | ||
# Refer to #11401 for full discussion. | ||
estimator.fit(X, y) | ||
|
||
|
||
def check_complex_data(name, estimator_orig): | ||
|
Uh oh!
There was an error while loading. Please reload this page.