Skip to content

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

Merged
jnothman merged 1 commit into
scikit-learn:masterfrom
jblackburne:remove-isclose
Sep 11, 2016
Merged

jnothman merged 1 commit into
scikit-learn:masterfrom
jblackburne:remove-isclose

Conversation

@jblackburne

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

jnothman commented Sep 7, 2016

Copy link
Copy Markdown
Member

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

amueller commented Sep 7, 2016

Copy link
Copy Markdown
Member

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

@jblackburne

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

amueller commented Sep 9, 2016

Copy link
Copy Markdown
Member

can you rebase please?

Comment thread doc/whats_new.rst Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@amueller

amueller commented Sep 9, 2016

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

LGTM

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

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