在 Jupyter Notebook 中查看 GridSearchCV 的进度

在 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)

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


回答:

您需要使用 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

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注