scikit-learn (short-form sklearn) is a package for statistical learning in Python.

Quick links:

Classification report

For classification tasks, we can output key metrics with the classification_report(), imported from sklearn.metrics import classification_report.

This outputs the precision, recall, F1-score, and support of the classes. The first column lists down what classes belong to the metrics (for a binary classifier, we see two: 0 and 1), and the accuracies.

Parallelisation

sklearn is single-threaded by default, which can be slow for many applications. If running on an x86 platform (including Intel/AMD CPUs and Intel GPUs), it’s possible to do architectural optimisations with the Intel Extension for Scikit-Learn. This is done by replacing stock sklearn algorithms:

from sklearnex import patch_sklearn
patch_sklearn()

After this, any calls to stock sklearn functions will use architecture-specific optimised functions.