April 2017
Beginner to intermediate
358 pages
9h 30m
English
We can use the existing parameter space and the existing classifier from our previous experiments—all we need to do is refit it on our new data. By default, training in scikit-learn is done from scratch—subsequent calls to fit() will discard any previous information.
As before, we can compute our scores by using cross_val_score and print the results. The code is as follows:
scores = cross_val_score(pipeline, documents, classes, scoring='f1') print("Score: {:.3f}".format(np.mean(scores)))
The result is 0.683, which is a reasonable result for such a messy dataset. Adding more ...
Read now
Unlock full access