negative value for “mean_squared_error”

◇◆丶佛笑我妖孽 提交于 2020-01-23 12:22:08

问题


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')

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/19993711/negative-value-for-mean-squared-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!