I have the following:
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier as RFC
par = {"n_estimators":n_estimators,
"max_depth":max_depth,
"class_weight":weight}
scores = {"AUC":"roc_auc","score":my_score} #Scores metric
rfc=RFC()
grid_rfc=GridSearchCV(rfc,
param_grid=par,
cv=10,
scoring=scores,
iid=False,
refit="AUC")
grid_rfc.fit(x_train,y_train)
I can then get the best parameters with grid_rfc.best_param
but the score
which provided the best parameters, is not listed.
As far as I understand, the score
is the one RFC
tries to maximize, so I do not get, why it is not present in the best parameter.
EDIT:
It is not the scoring that the RF produces that I am missing, but which scoring-function was used to fit the tree that gave the best result (e.g "AUC" or "my_score" from the score
dict)