I am trying to find the optimum paramaters for my MLP Regressor through parameters tuning using RandomizedSearch CV and then GridSearchCV. My question is should I mark early_stopping as True or False and why? I have read about it online but couldn't understand it well, based on what I read it, if it is marked as True then it can be useful to avoid overfitting?
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import RandomizedSearchCV
mlp = MLPRegressor(random_state=42)
param_grid_random = {'hidden_layer_sizes': [(18,), (18,18,), (18,18,18,)],
'activation': ['tanh','relu','logistic'],
'solver': ['sgd', 'adam'],
'learning_rate': ['constant','adaptive','invscaling'],
'alpha': [0.0001, 0.05],
'max_iter': [10000000000],
'early_stopping': [False],
'warm_start': [False]}
GS_random = RandomizedSearchCV(mlp, param_distributions=param_grid_random,n_jobs= 1,cv=5, scoring='r2', n_iter=100,random_state=42) #scoring='neg_mean_squared_error'
GS_random.fit(X_train, y_train)
print(GS_random.best_params_)