[scikit-learn] help
Joel Nothman
joel.nothman at gmail.com
Sat Jun 16 08:13:20 EDT 2018
Sorry, should have been model_selection, not model_evaluation.
cross_validation is now deprecated.
On Sat, 16 Jun 2018 at 18:28, Alexandra Metallinou Log <
alexandra.log at sintef.no> wrote:
> Thank you, this worked. The error message was: undefined keyword:
> 'score-func'
>
>
> I also changed the line of code from
>
>
> scores = cross_validation.cross_val_score(model, X, Y, cv = 10, score_func
> = metrics.mean_squared_error)
>
>
> to
>
>
> scores = cross_validation.cross_val_score(model, X, Y, cv = 10, scores =
> 'mean_squared_error')
>
>
> the code runs with this (I recieve negative outputs though, so I took the
> abolute value of these afterwards). However the following deprecation
> warning is displayed:
>
>
> C:\Python27\lib\site-packages\sklearn\cross_validation.py:41:
> DeprecationWarning: This module was deprecated in version 0.18 in favor of
> the model_selection module into which all the refactored classes and
> functions are moved. Also note that the interface of the new CV iterators
> are different from that of this module. This module will be removed in 0.20.
> "This module will be removed in 0.20.", DeprecationWarning)
> C:\Python27\lib\site-packages\sklearn\grid_search.py:42:
> DeprecationWarning: This module was deprecated in version 0.18 in favor of
> the model_selection module into which all the refactored classes and
> functions are moved. This module will be removed in 0.20.
> DeprecationWarning)
>
> When I changed the code to:
>
>
> model_evaluation.cross_val_score(model, X, y, scoring=
> 'neg_mean_squared_error'),
>
>
> the code runs fine ('neg_mse' was not an acceptable keyword). I still get
> the same deprecation warning, though I don't understand why as I am using
> model_evaluation now. Regardless, I think the problem is fixed.
>
>
> Once again, thank you for your help!
>
>
> Kind regards,
>
>
> Alexandra
> ------------------------------
> *Fra:* scikit-learn <scikit-learn-bounces+alexandra.log=
> sintef.no at python.org> på vegne av Joel Nothman <joel.nothman at gmail.com>
> *Sendt:* fredag 15. juni 2018 01.57.31
> *Til:* Scikit-learn user and developer mailing list
> *Emne:* Re: [scikit-learn] help
>
> model_evaluation.cross_val_score(model, X, y, scoring='neg_mse') will
> produce the same, but negated so that greater is better.
> _______________________________________________
> 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/20180616/ea633949/attachment-0001.html>
More information about the scikit-learn
mailing list