logo

... scikit metrics: refit



Notes

This is the code used run the gridsearch.

from sklearn.model_selection import GridSearchCV

grid = GridSearchCV(
    estimator=LogisticRegression(max_iter=1000),
    scoring={'precision': make_scorer(precision_score), 
            'recall': make_scorer(recall_score)},
    param_grid={'class_weight': [{0: 1, 1: v} for v in range(1, 4)]},
    refit='precision',
    return_train_score=True,
    cv=10,
    n_jobs=-1
)
grid.fit(X, y);

This is the code to view the results.

pd.DataFrame(grid.cv_results_)

Feedback? See an issue? Something unclear? Feel free to mention it here.



If you want to be kept up to date, consider signing up for the newsletter.