【问题标题】:what is difference between criterion and scoring in GridSearchCVGridSearchCV中的标准和评分有什么区别
【发布时间】:2021-02-16 21:31:30
【问题描述】:

我创建了一个 GradientBoostingRegressor 模型。

我在 GridSearchCV 函数中使用 scoring 参数来返回 MSE 分数。

我想知道如果我在 param_grids 中使用 criterion 会改变我的模型吗?哪个才是真道?

谢谢

GBR = GradientBoostingRegressor() 参数网格 = { 'learning_rate' : [0.01, 0.05, 0.07, 0.1, 0.3, 0.5 ], 'n_estimators':[50,60,70,80,90,100], 'max_depth' : [1, 2, 3, 4], 'min_samples_leaf':[1,2,3,5,10,15], 'min_samples_split': [2,3,4,5,10], #'标准':['mse'] } kf = KFold(n_splits=3, random_state=42, shuffle=True) gs = GridSearchCV(estimator=GBR, param_grid = param_grids, cv = kf, n_jobs=-1, return_train_score=真,评分='neg_mean_squared_error')

【问题讨论】:

    标签: python machine-learning linear-regression grid-search


    【解决方案1】:

    criterion 方法评估树中的拆分。 scoring 方法从整体上评估模型的质量。

    如果您想了解 如果它改变了您的模型,为什么不直接测试一下呢?这就是 GridSearchCV 擅长的。默认是 friedman_mse,所以:

    param_grids = {
                        'learning_rate'    : [0.01, 0.05, 0.07, 0.1, 0.3, 0.5 ],
                        'n_estimators'     : [50,60,70,80,90,100],
                        'max_depth'        : [1, 2, 3, 4],
                        'min_samples_leaf' : [1,2,3,5,10,15],
                        'min_samples_split': [2,3,4,5,10],  
                        'criterion' : ['friedman_mse', 'mse']
        }
    

    【讨论】:

      猜你喜欢
      • 2020-02-22
      • 2016-02-12
      • 2011-05-03
      • 2018-07-19
      • 2011-07-09
      • 1970-01-01
      • 2015-02-12
      • 2011-12-15
      相关资源
      最近更新 更多