is there a way to get the mean number of epochs when training stopped by EarlyStopping in GridSearch?

grid = GridSearch(estimator=model, param_grid=params, cv=10, scoring='accuracy', refit='acc')

results = grid.fit(X, y, epochs=200, valiation_data=(X_val, y_val), callbacks=[EarlyStopping(monitor='val_loss', patience=10, verbose=0, mode='min', restore_best_weights=True)])

Something like that:

for mean, stdev, param in zip(grid.cv_results_['mean_test_acc'],
                          grid.cv_results_['mean_epochs' ?????

Many thanks for every hint

  • 1
    $\begingroup$ Which libraries are you using? $\endgroup$ – Bill Chen Jan 30 at 17:51
  • $\begingroup$ @BillChen I'm using Keras and scikit-learn $\endgroup$ – Code Now Jan 30 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.