8000 GridSearchCV doesn't have decision_function before fit · Issue #3484 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

GridSearchCV doesn't have decision_function before fit #3484

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

Closed
larsmans opened this issue Jul 25, 2014 · 2 comments
Closed

GridSearchCV doesn't have decision_function before fit #3484

larsmans opened this issue Jul 25, 2014 · 2 comments

Comments

@larsmans
Copy link
Member

Since 83f67ee, GridSearchCV has decision_function and friends, but only after fitting. I just tried to tune each of the binary classifiers in an OvR constructor separately:

OneVsRestClassifier(GridSearchCV(LinearSVC(), parameters,
                                 cv=KFold(len(Y_train), 5)))

... but this doesn't work; it fails with

ValueError: The base estimator should implement decision_function or predict_proba!

because these methods are only available after fit has been called.

(Actually, the same is true of predict and transform. It's as if the type of a GridSearchCV changes after some of its methods have been called.)

@jnothman
Copy link
Member

Yes, because I'm still waiting for a review on #2854.

On 25 July 2014 23:12, Lars Buitinck notifications@github.com wrote:

Since 83f67ee
83f67ee,
GridSearchCV has decision_function and friends, but only after fitting. I
just tried to tune each of the binary classifiers in an OvR constructor
separately:

OneVsRestClassifier(GridSearchCV(LinearSVC(), parameters,
cv=KFold(len(Y_train), 5)))

... but this doesn't work; it fails with

ValueError: The base estimator should implement decision_function or predict_proba!

because these methods are only available after fit has been called.

(Actually, the same is true of predict and transform. It's as if the type
of a GridSearchCV changes after some of its methods have been called.)


Reply to this email directly or view it on GitHub
#3484.

@jnothman
Copy link
Member

In the context of which, I consider this issue a sub-issue of #1805, and am therefore closing. But I would certainly like to see a review on #2854, and when a pair of people volunteer to finally push it through, I will happily rebase it.

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

No branches or pull requests

2 participants
0