Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to know the progress in sklearn GridSearch

For grid search is always time consuming, so I want to see how much it run now. For example ,it might output

paramsXXX processed
paramsYYY processed
...
like image 955
mrbean Avatar asked Oct 17 '25 02:10

mrbean


2 Answers

To get the progress, you can increase the verbosity in e.g. sklearn.grid_search.GridSearchCV, by adding the parameter verbose and giving it some positive value

GridSearchCV(..., verbose=1)

From the docs

verbose : integer

Controls the verbosity: the higher, the more messages.

like image 76
bakkal Avatar answered Oct 18 '25 14:10

bakkal


If you want to know how much time GridSearchCV will take, you can run RandomizedSearchCV with n_iter=10 before running GridSearchCV. Let's say RandomizedSearchCV with n_iter=10 took 10s, GridSearchCV with 100 iterations will take almost 100s. This will give you a fairly accurate idea of how much time will GridSearchCV take.

Or even better you can run RandomizedSearchCV with n_iter=half the iterations of GridSearchCV to get almost same results with half the time.

like image 32
Abhishek Sharma Avatar answered Oct 18 '25 16:10

Abhishek Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!