-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
BUG: fix OrdinalEncoder with manually specified categories #12367
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
BUG: fix OrdinalEncoder with manually specified categories #12367
Conversation
def test_ordinal_encoder_specified_categories(X, X2, cats, cat_dtype): | ||
enc = OrdinalEncoder(categories=cats) | ||
exp = np.array([[0.], [1.]]) | ||
assert_array_equal(enc.fit_transform(X), exp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to use assert_allclose
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within the file, mainly assert_array_equal
is used, so I would stick with that for consistency.
Since it is here always about encoded integers, it should also not matter much in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM, thanks @jorisvandenbossche !
…ikit-learn#12367)" This reverts commit a48484d.
…ikit-learn#12367)" This reverts commit a48484d.
Closes #12365