[scikit-learn] modifying CV score

Joel Nothman joel.nothman at gmail.com
Wed Jan 4 22:06:43 EST 2017


Well, it returns the equivalent of

lambda estimator, X, y: estimator.score(X, y)



On 5 January 2017 at 08:47, Jonathan Taylor <jonathan.taylor at stanford.edu>
wrote:

> (Think this is right reply to from a digest... If not, apologies)
>
> Thanks for the pointers. From what I read on the API, I gather that for an
> estimator with a score method, inside GridSearchCV there will be
> pseudo-code like
>
>     ...
>     estimator.fit(X_train, y_train)
>     scorer = estimator.score
>     return scorer(X_test, y_test)
>
>
> For custom scores that are not methods of an estimator, I guess the
> `make_scorer` function returns a callable with the same signature as a
> score method of an estimator?
>
> --
> Jonathan Taylor
> Dept. of Statistics
> Sequoia Hall, 137
> 390 Serra Mall
> Stanford, CA 94305
> Tel:   650.723.9230 <(650)%20723-9230>
> Fax:   650.725.8977 <(650)%20725-8977>
> Web: http://www-stat.stanford.edu/~jtaylo
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170105/317ae056/attachment.html>


More information about the scikit-learn mailing list