Select the best estimator from the set of estimators.
best_model_id = first(results.info)
key = operator.itemgetter("model_id")
best_index = -1// history_results is sorted by (model_id, partial_fit_calls)// best is the model_id with the highest partial fit callsfor k, v in itertools.groupby(history_results, key=key):
v = list(v)
best_index += len(v)if k == best_model_id:
breakreturn results.models[best_model_id], best_index
def _process_results(self, results):
Called with the output of `fit` immediately after it finishes.