... scikit metrics.

If you're going to use optimise a model in scikit-learn then it better optimise towards the right thing. This means that you have to understand metrics in scikit-learn. This series of videos will give an overview in how they work, how you can create your own and how the gridsearch interacts with it.

Episode Notes

This is the code used run the gridsearch.

from sklearn.model_selection import GridSearchCV

grid = GridSearchCV(
    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)]},
grid.fit(X, y);

This is the code to view the results.


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

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