-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Array API support for confusion_matrix converting to numpy array #30562
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
Open
StefanieSenger
wants to merge
38
commits into
scikit-learn:main
Choose a base branch
from
StefanieSenger:array_api_confusion_matrix_numpy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−9
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
78d2a65
ENH Array API for confusion_matrix
StefanieSenger 770e638
fix dtype checking
StefanieSenger af440ca
prepare for PR
StefanieSenger b45646e
change log
StefanieSenger 3db7054
use our _isin
StefanieSenger abab5ea
changes after review
StefanieSenger abc3981
forgot to push that before
StefanieSenger 09cec5d
add test
StefanieSenger fdb25f6
fix sclar dtype
StefanieSenger 49f75b7
fix typos
StefanieSenger 914bb63
convert_to_numpy and coo_matrix instead of python loop
StefanieSenger a939c80
Merge branch 'main' into array_api_confusion_matrix
StefanieSenger 6da1d06
experiment with convert_to_numpy
StefanieSenger 1f23f63
np.intersect1d can stay as it is
StefanieSenger 6a43bc3
return cm as numpy array
StefanieSenger 2000a00
move attach unique to after conversion to numpy
StefanieSenger 5963e0f
adjust test
StefanieSenger ef84e04
document return array type
StefanieSenger 1cf525e
use get_namespace
StefanieSenger f50f3ea
fix issue with nullable dtypes with pandas==1.1.5
StefanieSenger 84038e4
private function
StefanieSenger b47fdc7
Update sklearn/metrics/_classification.py
StefanieSenger 1abc308
fix tests when pandas not installed
StefanieSenger 7325cdf
better fix for environments without pandas
StefanieSenger ba06676
remove _nan_to_num
StefanieSenger 3d9d986
Merge branch 'main' into array_api_confusion_matrix_numpy
StefanieSenger 5b21ad6
remove handling for pandas < 1.2.0
StefanieSenger 6776a11
remove handling of pandas if pandas not installed
StefanieSenger fa7564d
use check_array for handling pandas extension dtypes
StefanieSenger 6ee6afc
ensure_all_finite=False
StefanieSenger 32ea61e
add label passing to test to archive CodeCov
StefanieSenger e59cd7f
fix naming
StefanieSenger 5124f98
experiment - need to push so I can test on GPU
StefanieSenger 5034d01
convert labels to numpy
StefanieSenger 3cffcbf
Merge branch 'main' into array_api_confusion_matrix_numpy
StefanieSenger d42caa6
Update sklearn/metrics/tests/test_classification.py
StefanieSenger 094ca6d
remove unhelpful comment
StefanieSenger 869f568
Merge branch 'main' into array_api_confusion_matrix_numpy
StefanieSenger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- :func:`sklearn.metrics.confusion_matrix` now supports Array API compatible inputs. | ||
By :user:`Stefanie Senger <StefanieSenger>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we can replace these with a single line: