Our F1 score here is ~0.66, not bad but there’s room for improvement.
Let’s do some hyperparameter tuning to see if we can nudge that score up a bit. For the most part, our pipeline has stuck to just the default parameters. Here we’ll alter some of these parameters to see if we can improve on our F1 score from before.
We’ll set up a hyperparameter grid and do an exhaustive grid search on these hyperparameters. We start by setting up our hyperparameter grid using the
ParamGridBuilder, then we determine their performance using the
CrossValidator, which does k-fold cross validation (k=3 in this case).