Skip to content

[MRG] Simplify addition of point (0, 0) in roc_curve - #13523

Merged
adrinjalali merged 2 commits into
scikit-learn:masterfrom
wdevazelhes:simplify_roc_curve
Mar 28, 2019
Merged

adrinjalali merged 2 commits into
scikit-learn:masterfrom
wdevazelhes:simplify_roc_curve

Conversation

@wdevazelhes

Copy link
Copy Markdown
Contributor

After the modification of #10093, I think we can simplify the code because it's forced that we pass in one of the case tested by the "if":

  • if we have tps.size == 0 then we pass in it
  • otherwise, we have at least one element in tps and one element in fps (tps and fps have the same size)
    Then the first point is the first classified positive so it's either a true positive or a false positive. So I think we should pass in the "if" statement in any case

@wdevazelhes wdevazelhes changed the title first commit [WIP] Simplify addition of point (0, 0) in roc_curve Mar 26, 2019
@wdevazelhes wdevazelhes changed the title [WIP] Simplify addition of point (0, 0) in roc_curve [MRG] Simplify addition of point (0, 0) in roc_curve Mar 26, 2019

@jnothman jnothman left a comment

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.

Makes sense

Comment thread sklearn/metrics/ranking.py Outdated
tps = np.r_[0, tps]
fps = np.r_[0, fps]
thresholds = np.r_[thresholds[0] + 1, thresholds]
# Add an extra threshold position if necessary

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.

I guess then remove the "if necessary" part?

@wdevazelhes wdevazelhes Mar 28, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's right, thanks ! Done

@adrinjalali adrinjalali left a comment

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.

Thanks @wdevazelhes

@adrinjalali
adrinjalali merged commit 0a0db97 into scikit-learn:master Mar 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
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.

3 participants