... 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.


To run the whole thing with sample_weight, you only need to run;

grid.fit(X, y, sample_weight=np.log(1 + df['Amount']));

Note that we're not using the sample_weight in our own custom scorer, but you should see a huge effect on the metric.

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

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