Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG + 1] Remove np.isclose() from ROC curve calculation #7353

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

Merged
merged 1 commit into from
Sep 11, 2016

Conversation

jblackburne
Copy link
Contributor

This PR removes the use of np.isclose() when finding indices where y_score changes during calculation of ROC curves. It is equivalent to changing the tolerance parameters of isclose to 0. It is strictly a reversion of #3268.

Fixes #3864, as well as dupes #4864 and #6688.

There is relevant discussion on #6693. To me it seemed that the consensus was to take this course of action. Further comments are welcome too.

If this is merged, #6693 can probably be closed as OBE.

@jblackburne jblackburne changed the title Remove np.isclose() from ROC curve calculation [MRG] Remove np.isclose() from ROC curve calculation Sep 7, 2016
@jnothman jnothman added this to the 0.18 milestone Sep 7, 2016
@jnothman
Copy link
Member

jnothman commented Sep 7, 2016

I think at a minimum, this will require a what's new alerting users to the changed behaviour. Perhaps a non-regression test is also appropriate. Thanks for this. We'll squeeze it into an imminent release, perhaps?

@jnothman jnothman added the Bug label Sep 7, 2016
@amueller
Copy link
Member

amueller commented Sep 7, 2016

+1 for non-regression test with small values. +1 for 0.18

@jblackburne
Copy link
Contributor Author

Modified an existing test (test_score_scale_invariance) rather than adding a new test. The modified test fails on master but succeeds with this PR.

@amueller
Copy link
Member

amueller commented Sep 9, 2016

can you rebase please?

@@ -387,6 +387,11 @@ Bug fixes
- Fix :class:`linear_model.ElasticNet` sparse decision function to match
output with dense in the multioutput case.

- :func:`metrics.roc_curve` and :func:`metrics.precision_recall_curve` no
longer round `y_score` values when creating ROC curves; this was causing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double backticks. methinks.

…s_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
@jblackburne
Copy link
Contributor Author

Applied @amueller's suggesed fixes to the whatsnew entry, then rebased and squashed.

@amueller
Copy link
Member

amueller commented Sep 9, 2016

lgtm

@amueller amueller changed the title [MRG] Remove np.isclose() from ROC curve calculation [MRG + 1] Remove np.isclose() from ROC curve calculation Sep 9, 2016
@jnothman
Copy link
Member

LGTM

@jnothman jnothman merged commit ba7cf38 into scikit-learn:master Sep 11, 2016
@jnothman
Copy link
Member

Thanks @jblackburne :)

@jblackburne jblackburne deleted the remove-isclose branch September 12, 2016 05:49
rsmith54 pushed a commit to rsmith54/scikit-learn that referenced this pull request Sep 14, 2016
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
@amueller amueller mentioned this pull request Oct 11, 2016
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in metrics.roc_auc_score
3 participants