"mean_squared_error"的负值; [英] negative value for "mean_squared_error"

查看:1885
本文介绍了"mean_squared_error"的负值;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用scikit并将mean_squared_error用作评分函数,用于cross_val_score中的模型评估.

I am using scikit and using mean_squared_error as a scoring function for model evaluation in cross_val_score.

rms_score = cross_validation.cross_val_score(model, X, y, cv=20, scoring='mean_squared_error')

我正在使用mean_squared_error,因为这是一个回归问题,并且使用的估计量(模型)为lassoridgeelasticNet.

I am using mean_squared_error as it is a regression problem and the estimators (model) used are lasso, ridge and elasticNet.

对于所有这些估计量,我都会得到rms_score作为负值.鉴于y值的差是平方的事实,这怎么可能.

For all these estimators, I am getting rms_score as negative values. How is it possible, given the fact that the differences in y values are squared.

推荐答案

您会得到带有cross_validation.cross_val_score返回的符号翻转的mean_squared_error.为此有一个发行版( https://github.com/scikit-learn /scikit-learn/issues/2439 ),如果这是API或文档错误,则会引起争议.

You get the mean_squared_error with sign flipped returned by cross_validation.cross_val_score. There is an issued opened for that (https://github.com/scikit-learn/scikit-learn/issues/2439), it's controversial if that is an API- or documentation bug.

这篇关于"mean_squared_error"的负值;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆