【问题标题】:Learning curve function on Scikit learnScikit learn 上的学习曲线功能
【发布时间】:2020-11-15 10:42:08
【问题描述】:

我想为我的回归问题绘制一条学习曲线,使用 RMSE 作为“评分参数”。

如何设置不同的“评分”参数?似乎学习曲线功能中不推荐使用“评分”...

谁能帮帮我?或者给我推荐其他功能...

【问题讨论】:

    标签: machine-learning scikit-learn scoring


    【解决方案1】:

    最新版本https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.learning_curve.htmlscoring参数。

    如果你的意思是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)
    ...
    
    

    【讨论】:

    猜你喜欢
    • 2020-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-25
    • 2016-06-18
    • 2019-05-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多