-
Notifications
You must be signed in to change notification settings - Fork 112
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
ENH: move get_true_label_position to utils in classification #427
ENH: move get_true_label_position to utils in classification #427
Conversation
mapie/tests/test_classification.py
Outdated
@@ -1865,8 +1869,7 @@ def test_get_true_label_position( | |||
y_pred_proba = y_true_proba_place[1] | |||
place = y_true_proba_place[2] | |||
|
|||
mapie = MapieClassifier(random_state=random_state) | |||
found_place = mapie._get_true_label_position(y_pred_proba, y_true) | |||
found_place = get_true_label_position(y_pred_proba, y_true) |
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.
This test should be implemented directly in test_utils_classification_conformity_scores
expected_position = np.array([[0], [0], [1], [1]]) | ||
|
||
assert np.array_equal(position, expected_position) | ||
assert position.shape == y.shape |
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.
Your tests must test only one thing at a time. For the test on the shape, you can take some random np arrays with larger sizes
Hey @BaptisteCalot, |
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.
Thank you for your first PR, which is appropriate for the problem to be solved.
Description
1- Move get_true_label_position function from classification.py to a new utils file
2- Add a test for this function
How Has This Been Tested?
1- Check if the return of my function is correct
2- Check if the shape of my function's return is correct