Skip to content

Conversation

@BaptisteCalot
Copy link
Collaborator

@BaptisteCalot BaptisteCalot commented Apr 9, 2024

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


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)
Copy link
Collaborator

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
Copy link
Collaborator

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

@LacombeLouis
Copy link
Collaborator

Hey @BaptisteCalot,
Thank you for this PR! For the moment it doesn't pass some tests, but we have fixed the issue. So you can git merge upstream/main and everything should work!
Thank you!

Copy link
Collaborator

@thibaultcordier thibaultcordier left a 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.

@thibaultcordier thibaultcordier merged commit 1b57a04 into master May 14, 2024
@Valentin-Laurent Valentin-Laurent deleted the 426-move-some-methods-of-mapieclassifier-to-a-utils-file branch November 12, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move some methods of MapieClassifier to a utils file

4 participants