Extension for Scikit-learn*
Scale your scikit-learn* (sklearn) workflows by changing a couple of lines of code.
Accelerate scikit-learn for Data Analytics & Machine Learning
Scikit-learn* (often referred to as sklearn) is a Python* module for machine learning. Extension for Scikit-learn* seamlessly speeds up your scikit-learn applications for Intel CPUs and GPUs across single- and multi-node configurations. This extension package dynamically patches scikit-learn estimators while improving performance for your machine learning algorithms.
Using scikit-learn with this extension, you can:
- Get an average speed up of 8.5x on training and inference with equivalent mathematical accuracy.
- Continue to use the open source scikit-learn API.
- Enable and disable the extension with a couple lines of code or at the command line.
Download the Stand-Alone Version
A stand-alone version Extension for Scikit-learn is available. You can install from the PIP* package manager for Python or Anaconda*, or download and build from the source.
Features
Drop-in Acceleration
- Speed up scikit-learn (sklearn) algorithms by replacing existing estimators with mathematically-equivalent accelerated versions. Supported Algorithms
- Run on your choice of an x86-compatible CPU or Intel GPU because the accelerations are powered by Intel® oneAPI Data Analytics Library (oneDAL).
- Choose how to apply the accelerations:
- Patch all compatible algorithms from the command line with no code changes.
- Add two lines of code to patch all compatible algorithms in your Python script.
- Specify in your script to patch only selected algorithms.
- Globally patch and unpatch your environment for all uses of scikit-learn.
Example Patch Using Two Lines of Code
import numpy as np
# Turn on scikit-learn optimizations with these 2 simple lines:
from sklearnex import patch_sklearn
patch_sklearn()
# Import scikit-learn algorithms after the patch is enabled
from sklearn.cluster import KMeans
X = np.array([[1, 2], [1, 4], [1, 0],
[10, 2], [10, 4], [10, 0]])
kmeans = KMeans(n_clusters=2, random_state=0).fit(X)
print(f"kmeans.labels_ = {kmeans.labels_}")
Benchmarks
Documentation & Code Samples
Documentation
Code Samples
Get Started
Get Started with Extension for Scikit-learn
Learn how to use the machine learning algorithms available with scikit-learn. This example uses a support vector machine classifier (SVC) for the digit recognition problem.
Speed Up Machine Learning
Kaggle* Kernels
See how to use scikit-learn and Extension for Scikit-learn to speed up machine learning tasks: classification, regression, and AutoML workflows.
Extension for Scikit-learn Notebooks
With these Python* notebooks as examples, learn to use this extension for popular datasets.
Implement a Machine Learning Workload
End-to-End Census Workload
Build and run an end-to-end machine learning workload that uses Intel® Distribution of Modin* for extract, transform, and load (ETL) operations, and the Extension for Scikit-learn ridge regression algorithm.
Training
Machine Learning Workloads Acceleration
Demos
Optimize Utility Maintenance Prediction for Better Service
Get started using a reference kit to predict the health of utility assets and the probability of failure using scikit-learn SVC. Compare its effectiveness with an XGBoost algorithm.
Drive 2x Performance into Your scikit-learn Machine Learning Tasks
This video demonstrates how to use Extension for Scikit-learn, how it accelerates scikit-learn algorithms, and shows examples of end-to-end census and distributed linear regression.
Save Time and Money with Extension for Scikit-learn
Accelerating scikit-learn algorithms can deliver performance improvements up to and sometimes exceeding 100x. If you are running in a commercial cloud environment, this can deliver significant compute cost savings.
Case Studies
Supply-Chain Optimization at an Enterprise Scale
Architects from Red Hat* and Intel walk through the process of building an application to predict late deliveries using Red Hat OpenShift* Data Science and AI Tools.
HippoScreen* Improves AI Performance by 2.4x
The Taiwan-based neurotechnology startup combined its proprietary algorithms with accelerated scikit-learn algorithms to improve machine learning efficiency and training times for its Brain Waves AI system.
Specifications
Processors:
- All CPUs with x86 architecture
- All integrated and discrete GPUs from Intel
Operating systems:
- Linux*
- Windows* and Windows Server*
Language:
- Python
Get Help
Your success is our success. Access these support resources when you need assistance.
For additional help, see our general Support.