Search code examples
pythonmachine-learninggridsearchcv

GridSearchCV Not Showing Verbose Levels


The Verbose arguement in the GridSearchCV function displays the processing steps for each execution. Las time when I used, it worked just fine. But when I ran the model today, the verbose steps are not displaying. I didn't change my code at all. It's just the same.

model_gbm_sk = GradientBoostingClassifier(random_state = 0)
params_gbm = {'learning_rate':[0.05,0.1,0.2,0.3], 'n_estimators':[50,100], 'max_depth':[3,6,9,None]}
grid_gbm_sk = GridSearchCV(model_gbm_sk, params_gbm, scoring = 'accuracy', cv = 5, verbose = 5, n_jobs = -1, return_train_score = True)
grid_gbm_sk.fit(X_train, y_train)

for which the output displayed was Fitting 5 folds for each of 32 candidates, totalling 160 fits and nothing else after that. What's worse, the time for execution increased a lot than before. I only updated the version of scikit-learn via the pip command. Is this happening due to updating the version, or is there any other reason?


Solution

  • The problem is with the new version of Scikit-learn (0.24.1). When I reverted to the previous version (0.23.2) and ran the model again, it is working just fine like how it used to work. So my suggestion is not to use the latest version of sklearn (0.24.0 and 0.24.1) and continue with the version 0.23.2. This way, our models will run soon.

    pip install scikit-learn==0.23.2