Repository navigation
[MRG]Fix issue for normalized_mutual_info_score not returning error for continuous values. - #17938
Closed
Ashutosh619-sudo wants to merge 13 commits into
Closed
Ashutosh619-sudo wants to merge 13 commits into
Ashutosh619-sudo wants to merge 13 commits into
Conversation
swierh
reviewed
Jul 21, 2020
swierh
left a comment
Contributor
There was a problem hiding this comment.
In the MR and issue it states that normalized_mutual_info_score is for classification only. So shouldn't the function that checks the arrays be identical to the one used for other classification metrics (i.e. check_targets)?
Or are the input requirements of these two functions not identical?
Comment on lines
+48
to
+52
| if (type_of_target(labels_true) == "continuous" or | ||
| type_of_target(labels_pred) == "continuous"): | ||
| raise ValueError('Classification metrics expects discrete \ | ||
| values received %r for label, and %r \ | ||
| for target' % (labels_pred.dtype.type, labels_true.dtype.type)) |
Contributor
There was a problem hiding this comment.
Is there a reason you're not using the check_targets function from the classification module?
Author
There was a problem hiding this comment.
No there is no particular reason for using that. As only categorical arrays are allowed type_of_target gets the job done.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reference Issues/PRs
Fixes #17892
What does this implement/fix? Explain your changes.
Fix of issue normalized_mutual_info_score not returning error for continuous values. as it is only for classification. In the check_clustering function, we are checking if the type of arrays passed are discrete or continuous and if continuous throwing a ValueError for the same.
Any other comments?