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

Skip to content

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

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 2 commits into from
Mar 28, 2019

Conversation

wdevazelhes
Copy link
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
Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Makes sense

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
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?

Copy link
Contributor Author

@wdevazelhes wdevazelhes Mar 28, 2019

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

Copy link
Member

@adrinjalali adrinjalali left a comment

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