One of the ways to do it is to set the verbose
parameter of your grid search to an integer higher than 0 like 10 or more, it will print the result for each iteration to the console.
With this, your output should be print or logged to your console,
Then follow the answer to this or this question to see how to put the logged result to a file.
Basically, put this before running the GridSearch
:
import sys
old_stdout = sys.stdout
log_file = open("message.log","w")
sys.stdout = log_file
Then after running your GridSearch
, you should close all resources with this:
sys.stdout = old_stdout
log_file.close()