【问题标题】:GridSearchCV progress in Jupiter NotebookJupyter Notebook 中的 GridSearchCV 进度
【发布时间】:2019-10-23 01:22:12
【问题描述】:

是否可以在 Jupyter Notebook 中查看 GridSearchCV 的进度?我在 python 中运行这个脚本:

param_grid = {'learning_rate': [0.05, 0.10, 0.15, 0.20, 0.25, 0.30] ,
'max_depth'        : [3, 4, 5, 6, 8, 10, 12, 15],
'min_child_weight' : [1, 3, 5, 7],
'gamma'            : [0.0, 0.1, 0.2 , 0.3, 0.4],
'colsample_bytree' : [0.3, 0.4, 0.5 , 0.7],
'verbose'          : [100] }

xgboost_reg = XGBRegressor()
grid_search = GridSearchCV(xgboost_reg, param_grid, cv=5, scoring='neg_mean_squared_error', return_train_score=True)
grid_search.fit(my_data, my_labels, verbose=False)

我只能在单元格的输出中看到一些警告。

【问题讨论】:

标签: python machine-learning jupyter-notebook xgboost gridsearchcv


【解决方案1】:

你想要verbose参数:

grid_search = GridSearchCV(xgboost_reg, param_grid, cv=5, scoring='neg_mean_squared_error', return_train_score=True, verbose=2)
grid_search.fit(my_data, my_labels, verbose=False)

我在玩具数据上得到的一个例子:

Fitting 3 folds for each of 5 candidates, totalling 15 fits
[CV] C=0.1 ...........................................................
[CV] ............................................ C=0.1, total=   0.0s
[CV] C=0.1 ...........................................................
[CV] ............................................ C=0.1, total=   0.0s
[CV] C=0.1 ...........................................................
[CV] ............................................ C=0.1, total=   0.0s
[CV] C=0.5 ...........................................................
[CV] ............................................ C=0.5, total=   0.0s
[CV] C=0.5 ...........................................................
[CV] ............................................ C=0.5, total=   0.0s
[CV] C=0.5 ...........................................................
[CV] ............................................ C=0.5, total=   0.0s

【讨论】:

    猜你喜欢
    • 2018-06-12
    • 2018-11-17
    • 2019-07-09
    • 1970-01-01
    • 2017-07-01
    • 1970-01-01
    • 2019-03-15
    • 2018-03-29
    • 1970-01-01
    相关资源
    最近更新 更多