Python 如何使用GridSearchCV.best_分数计算RMSE_

Python 如何使用GridSearchCV.best_分数计算RMSE_,python,scikit-learn,Python,Scikit Learn,我目前正在使用记分器“负均方误差”,但我想要均方根误差 randsearch = RandomizedSearchCV(estimator=reg, param_distributions=param_grid, n_iter=n_iter_for_rand, cv=cv_for_rand, scoring="neg_mean_absolute_error",verbose=0, n_jobs=-1,refit=True) 我能把数据拟合一下吗。然后做: math.sqrt(randsearc

我目前正在使用记分器“负均方误差”,但我想要均方根误差

randsearch = RandomizedSearchCV(estimator=reg, param_distributions=param_grid, n_iter=n_iter_for_rand, cv=cv_for_rand, scoring="neg_mean_absolute_error",verbose=0, n_jobs=-1,refit=True)
我能把数据拟合一下吗。然后做:

math.sqrt(randsearch.best_score_)

或者我需要用“sklearn.metrics.make_scorer”制作一个客户记分器吗?

您只需对数据进行拟合,然后取
math.sqrt(-randsearch.best_score)