Intel® Extension for Scikit-learn*

Intel(R) Extension for Scikit-learn is a free software AI accelerator designed to deliver up to 100X faster performance for your existing scikit-learn code. The software acceleration is achieved with vector instructions, AI hardware-specific memory optimizations, threading, and optimizations for all upcoming Intel(R) platforms at launch time.

Designed for Data Scientists and Framework Designers

Use Intel(R) Extension for Scikit-learn, to:

  • Speed up training and inference by up to 100x with the equivalent mathematical accuracy

  • Benefit from performance improvements across different x86-compatible CPUs or Intel(R) GPUs

  • Integrate the extension into your existing Scikit-learn applications without code modifications

  • Enable and disable the extension with a couple of lines of code or at the command line

Intel(R) Extension for Scikit-learn is also a part of Intel(R) AI Tools.

_images/scikit-learn-acceleration.PNG

These performance charts use benchmarks that you can find in the scikit-learn bench repository.

Supported Algorithms

See all of the Supported Algorithms.

Intel(R) Optimizations

Enable Intel(R) CPU Optimizations

import numpy as np
from sklearnex import patch_sklearn
patch_sklearn()

from sklearn.cluster import DBSCAN

X = np.array([[1., 2.], [2., 2.], [2., 3.],
            [8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)
clustering = DBSCAN(eps=3, min_samples=2).fit(X)

Enable Intel(R) GPU optimizations

import numpy as np
import dpctl
from sklearnex import patch_sklearn, config_context
patch_sklearn()

from sklearn.cluster import DBSCAN

X = np.array([[1., 2.], [2., 2.], [2., 3.],
            [8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)
with config_context(target_offload="gpu:0"):
    clustering = DBSCAN(eps=3, min_samples=2).fit(X)