我预计这两种方法都会返回相当相似的错误,有人可以指出我的错误吗?
计算均方根误差...
rf = RandomForestRegressor(random_state=555, n_estimators=100, max_depth=8)
rf_preds = cross_val_predict(rf, train_, targets, cv=7, n_jobs=7)
print("RMSE Score using cv preds: {:0.5f}".format(metrics.mean_squared_error(targets, rf_preds, squared=False)))
scores = cross_val_score(rf, train_, targets, cv=7, scoring='neg_root_mean_squared_error', n_jobs=7)
print("RMSE Score using cv_score: {:0.5f}".format(scores.mean() * -1))
RMSE Score using cv preds: 0.01658
RMSE Score using cv_score: 0.01073
森栏
交互式爱情
随时随地看视频慕课网APP
相关分类