【发布时间】:2020-11-15 10:42:08
【问题描述】:
我想为我的回归问题绘制一条学习曲线,使用 RMSE 作为“评分参数”。
如何设置不同的“评分”参数?似乎学习曲线功能中不推荐使用“评分”...
谁能帮帮我?或者给我推荐其他功能...
【问题讨论】:
标签: machine-learning scikit-learn scoring
我想为我的回归问题绘制一条学习曲线,使用 RMSE 作为“评分参数”。
如何设置不同的“评分”参数?似乎学习曲线功能中不推荐使用“评分”...
谁能帮帮我?或者给我推荐其他功能...
【问题讨论】:
标签: machine-learning scikit-learn scoring
最新版本https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.learning_curve.html有scoring参数。
如果你的意思是plot_learning_curve 函数从那里https://scikit-learn.org/stable/auto_examples/model_selection/plot_learning_curve.html#sphx-glr-auto-examples-model-selection-plot-learning-curve-py
你可以这样改:
def plot_learning_curve(estimator, title, X, y, axes=None, ylim=None, cv=None,
n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5), scoring='metric'):
...
train_sizes, train_scores, test_scores, fit_times, _ = \
learning_curve(estimator, X, y, cv=cv, n_jobs=n_jobs,
train_sizes=train_sizes,
return_times=True, scoring=scoring)
...
【讨论】:
make_scorer 来做这个