我有估算 k 折交叉验证的 RMSE 的代码,我认为它是正确的(摘自书籍:使用 Scikit-Learn、Keras 和 TensorFlow 进行机器学习,Aurélien Géron 的第二版)
scores = cross_val_score(forest_reg, a, b, scoring="neg_mean_squared_error", cv=10)
print(pd.Series(np.sqrt(-scores)).describe())
那么MAE呢?我应该使用(与sqrt):
scores = cross_val_score(forest_reg, a, b, scoring="neg_mean_absolute_error", cv=10)
print(pd.Series(np.sqrt(-scores)).describe())
或者这个(没有sqrt):
scores = cross_val_score(forest_reg, a, b, scoring="neg_mean_absolute_error", cv=10)
print(pd.Series(-scores).describe())
同样对于 MAE 估计,它应该是 -scoresor scores?