By default, parameter search uses the score function of the estimator
to evaluate a parameter setting. These are the
sklearn.metrics.accuracy_score for classification and
sklearn.metrics.r2_score for regression.
An alternative scoring function can be specified via the scoring
parameter to GridSearchCV, RandomizedSearchCV and many of the
specialized cross-validation tools described below.
^{} 使用R^2作为评分标准。从docs:
要使用另一种评分标准,例如均方误差,您需要使用^{} 或^{} (而不是^{} ),并将
scoring
参数指定为scoring='neg_mean_squared_error'
。从docs:我认为公认的答案是错误的,因为它引用了网格搜索的文档,但是
LassoCV
使用正则化路径,而不是网格搜索。 事实上,在LassoCV
的docs页面中,它说loss函数是:这意味着最小均方误差(加上套索项)。
相关问题 更多 >
编程相关推荐