Skip to content

[MRG] fixes #4577 adds interpolation to PR curve - #4936

Closed
chiragnagpal wants to merge 6 commits into
scikit-learn:masterfrom
chiragnagpal:prcurve
Closed

chiragnagpal wants to merge 6 commits into
scikit-learn:masterfrom
chiragnagpal:prcurve

Conversation

@chiragnagpal

Copy link
Copy Markdown

fixes #4577 Added boolean parameter 'interpolated' to sklearn.metrics.precision_recall_curve(). Returns an interpolated, de-noised precision score, if True

@agramfort

Copy link
Copy Markdown
Member

there is no test

Comment thread sklearn/metrics/ranking.py Outdated

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.

It would be better to do

if interpolate
    ....
else:
    ....

@chiragnagpal

Copy link
Copy Markdown
Author

@agramfort @arjoly I'll add a unit test and update the documentation and pull in another request, soon

@arjoly

arjoly commented Jul 8, 2015

Copy link
Copy Markdown
Member

You can also update this pull request by pushing your changes.

@chiragnagpal

Copy link
Copy Markdown
Author

pushed changes to the pull request.

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.

why don't you use the interpolate module from scipy?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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.

because that does something differently, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

scipy.interpolate function is used to perform curve fitting on a set of data points. Here, we don't need to perform curve fitting. all we need is to ensure that the value of precision does not fall, for decreasing values of recall.

@arjoly

arjoly commented Jul 9, 2015

Copy link
Copy Markdown
Member

my question in #4577 applies for this pr.

@agramfort

Copy link
Copy Markdown
Member

@amueller

Copy link
Copy Markdown
Member

should we make this the default in the future? That is set the default to None and raise a ChangedBehaviorWarning?

@amueller

Copy link
Copy Markdown
Member

can you add a reference to the IR book in the docstring maybe?

@chiragnagpal

Copy link
Copy Markdown
Author

added reference to the IR book in the docstring. Are we looking at making interpolation the default behaviour?

@agramfort

Copy link
Copy Markdown
Member

please update the example that demos PR curve.

@chiragnagpal

Copy link
Copy Markdown
Author

@agramfort updated example, with some text on interpolation.

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.

by a too small amount?

@agramfort

Copy link
Copy Markdown
Member

travis is not happy.

@chiragnagpal

Copy link
Copy Markdown
Author

@agramfort travis is returning an error because in the updated doc string the reference to the IR book includes the author "Schütze" and 'ü' is a non ascii character, I thought of changing it to 'u'. But was unsure if that would be correct.

Here is the error output from the travis build:

ERROR: Failure: SyntaxError (Non-ASCII character '\xc3' in file /home/travis/build/scikit-learn/scikit-learn/sklearn/metrics/ranking.py on line 392, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (ranking.py, line 391))

@agramfort

Copy link
Copy Markdown
Member

add

-- coding: utf-8 --

on top of your file.

@GaelVaroquaux

GaelVaroquaux commented Jul 24, 2015 via email

Copy link
Copy Markdown
Member

Comment thread sklearn/metrics/ranking.py Outdated

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 don't know where he's from but if he's German you can write Schuetze. I don't think anyone would kill you for Schutze, though.

@amueller

Copy link
Copy Markdown
Member

@GaelVaroquaux @agramfort how do we feel about changing the default behavior?

@GaelVaroquaux

GaelVaroquaux commented Jul 31, 2015 via email

Copy link
Copy Markdown
Member

@amueller

Copy link
Copy Markdown
Member

ok let's do that.

@chiragnagpal

Copy link
Copy Markdown
Author

@amueller @GaelVaroquaux @agramfort
sorry guys, I know this ones long overdue, I was running against a poster deadline.
Interpolation is still not the default behavior. Let me know if that is fine.

@amueller

amueller commented Aug 4, 2015

Copy link
Copy Markdown
Member

Do you know how deprecations work?
The default behavior should be None and if None is specified, it will use no interpolation, but warn that in the future (version 0.18), interpolation will be the default.

@chiragnagpal

Copy link
Copy Markdown
Author

@amueller I have added a deprecation warning. Request Review.

@amueller amueller changed the title referencing #4577 adds interpolation to PR curve [MRG] referencing #4577 adds interpolation to PR curve Aug 5, 2015
@amueller

amueller commented Aug 5, 2015

Copy link
Copy Markdown
Member

Thanks. Sorry, I'm a bit too busy to review at the moment :-/ hopefully someone else finds the time.

@chiragnagpal

Copy link
Copy Markdown
Author

👍

@chiragnagpal

Copy link
Copy Markdown
Author

Hi, this has been pending for a long time!

@amueller

Copy link
Copy Markdown
Member

Thanks for the ping. Sorry, I've been swamped and it seems no-one else had time.

@raghavrv

Copy link
Copy Markdown
Member

Could you reference the issue in your PR description? Refer this

@chiragnagpal chiragnagpal changed the title [MRG] referencing #4577 adds interpolation to PR curve [MRG] fixes #4577 adds interpolation to PR curve Dec 11, 2015
@chiragnagpal

chiragnagpal commented Dec 11, 2015 •

Copy link
Copy Markdown
Author

@raghavrv i guess the github doesnt allow me to update a PR description from the web interface. however stack overflow suggests that the github api allows it. Weird. 😕 I'll take care of that next time anyhow.

@raghavrv

Copy link
Copy Markdown
Member

You could just press the edit icon on the top right corner of your PR description box ;)

image

Also nevermind... I was just adding a future note kind-of :) Thanks for the PR!

@chiragnagpal

chiragnagpal commented Dec 11, 2015 •

Copy link
Copy Markdown
Author

@raghavrv this could probbly go in the most dedicated github replies in history. :D

@amueller

amueller commented Dec 11, 2015 •

Copy link
Copy Markdown
Member

@raghavrv is pretty dedicated indeed ;)

@GaelVaroquaux

GaelVaroquaux commented Dec 11, 2015 via email •

Copy link
Copy Markdown
Member

@raghavrv

Copy link
Copy Markdown
Member

Haha! Thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Precision Recall numbers computed by Scikits are not interpolated (non-standard)

8 participants