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

Skip to content

Conversation

@black-puppydog
Copy link

I raised this issue a while back on the mailing list.
When using GridSearchCV on a MetaEstimator wrapping an SVC (not LinearSVC) with a precomputed=True the Gram matrix does not get sliced correctly.
For me this was occurring because the default One-vs-One strategy for the SVC is not what I want.
This patch tells GridSearchCV that the input needs to be sliced along both dimensions.

As stated before, I am not deep enough into the code base to see if this will have any drawbacks but for me this has been working well for some time and it does not change the test results i get when calling make.

@amueller
Copy link
Member

Which MetaEstimator? OneVsRest? I guess there is no harm in doing it here... But then it should be removed from the meta-estimators like GridSearchCV. And you should add a test fro OneVsRest if that was the problem.

@jnothman
Copy link
Member

We haven't explicitly stated that "estimator" is the right param...

On 14 October 2015 at 06:54, Andreas Mueller [email protected]
wrote:

Which MetaEstimator? OneVsRest? I guess there is no harm in doing it
here... But then it should be removed from the meta-estimators like
GridSearchCV. And you should add a test fro OneVsRest if that was the
problem.


Reply to this email directly or view it on GitHub
#5393 (comment)
.

@jnothman
Copy link
Member

I mean that all MetaEstimatorMixin users have a param named estimator.

On 14 October 2015 at 07:18, Joel Nothman [email protected] wrote:

We haven't explicitly stated that "estimator" is the right param...

On 14 October 2015 at 06:54, Andreas Mueller [email protected]
wrote:

Which MetaEstimator? OneVsRest? I guess there is no harm in doing it
here... But then it should be removed from the meta-estimators like
GridSearchCV. And you should add a test fro OneVsRest if that was the
problem.


Reply to this email directly or view it on GitHub
#5393 (comment)
.

@amueller
Copy link
Member

whoops good catch.

@black-puppydog
Copy link
Author

Yes, I am using OneVsRest, to get around the default OneVsOne strategy in SVC.
I don't quite understand what you mean with removing it from GridSearchCV.
GridSearchCV itself also uses the MetaEstimatorMixin so with this patch it would also announce that the wrapped (Meta-)Estimator uses a pairwise matrix.
Is that a bad idea?

I'll have a look on how the tests are written.

@amueller
Copy link
Member

Disregard my previous comment, @jnothman pointed out hat your fix doesn't really work. You should add it in OneVsRestClassifier and OneVsOneClassifier not MetaEstimatorMixin.

@amueller amueller added this to the 0.17 milestone Oct 14, 2015
@lesteve lesteve modified the milestones: 0.17, 0.18 Jul 27, 2016
@amueller
Copy link
Member

fixed in #7350.

@amueller amueller closed this Sep 25, 2016
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.

4 participants