-
Notifications
You must be signed in to change notification settings - Fork 208
[ENH] Adds a check for consistent output for predict and predict_proba #2824
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -374,3 +374,10 @@ def check_classifier_output(estimator, datatype): | |
# check predict proba (all classifiers have predict_proba by default) | ||
y_proba = estimator.predict_proba(FULL_TEST_DATA_DICT[datatype]["test"][0]) | ||
_assert_predict_probabilities(y_proba, datatype, n_classes=len(unique_labels)) | ||
|
||
y_pred_proba = np.argmax(y_proba, axis=1) | ||
_assert_predict_labels(y_pred_proba, datatype, unique_labels=unique_labels) | ||
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. is line 379 necessary? 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. I just added it as we were checking the |
||
|
||
np.testing.assert_array_equal( | ||
y_pred, y_pred_proba, err_msg="predict and predict_proba are not consistent" | ||
) |
Uh oh!
There was an error while loading. Please reload this page.