Metadata-Version: 2.1
Name: daal4py
Version: 2021.5.0
Summary: A convenient Python API to Intel(R) oneAPI Data Analytics Library
Home-page: https://github.com/IntelPython/daal4py
Author: Intel Corporation
Author-email: scripting@intel.com
Maintainer-email: onedal.maintainers@intel.com
License: Apache-2.0
Project-URL: Bug Tracker, https://github.com/IntelPython/daal4py/issues
Project-URL: Documentation, https://intelpython.github.io/daal4py/
Project-URL: Source Code, https://github.com/IntelPython/daal4py
Keywords: machine learning,scikit-learn,data science,data analytics
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Other Audience
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: System
Classifier: Topic :: Software Development
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: doc/daal4py/third-party-programs.txt
# Intel(R) Extension for Scikit-learn*
[Installation](INSTALL.md) | [Documentation](https://intel.github.io/scikit-learn-intelex/) | [Examples](https://github.com/intel/scikit-learn-intelex/tree/master/examples/notebooks) | [Support](#-support) | [FAQ](#-faq)
[](https://dev.azure.com/daal/daal4py/_build/latest?definitionId=9&branchName=master)
[](https://scan.coverity.com/projects/daal4py)
[](https://github.com/intel/scikit-learn-intelex/discussions)
[](https://pypi.org/project/scikit-learn-intelex/)
[](https://anaconda.org/conda-forge/scikit-learn-intelex)
[](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue)
With Intel(R) Extension for Scikit-learn you can accelerate your Scikit-learn applications and still have full conformance with all Scikit-Learn APIs and algorithms. This is a **free software AI accelerator** that brings over **10-100X** acceleration across a variety of applications. And you do not even need to change the existing code!
## How it works?
Intel(R) Extension for Scikit-learn offers you a way to accelerate existing scikit-learn code.
The acceleration is achieved through **patching**: replacing the stock scikit-learn algorithms with their optimized versions provided by the extension.
One of the ways to patch scikit-learn is by modifying the code. You import an additional Python package (`sklearnex`) and enable optimizations via `sklearnex.patch_sklearn()`:
- **Enable Intel CPU optimizations**
```py
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 GPU optimizations**
```py
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)
```
๐ Read about [other ways to patch scikit-learn](https://intel.github.io/scikit-learn-intelex/index.html#usage) and [other methods for offloading to GPU devices](https://intel.github.io/scikit-learn-intelex/oneapi-gpu.html).
Check out available [notebooks](https://github.com/intel/scikit-learn-intelex/tree/master/examples/notebooks) for more examples.
This software acceleration is achieved through the use of vector instructions, IA hardware-specific memory optimizations, threading, and optimizations for all upcoming Intel platforms at launch time.
## Supported Algorithms
โ The patching only affects [selected algorithms and their parameters](https://intel.github.io/scikit-learn-intelex/algorithms.html).
You may still use algorithms and parameters not supported by Intel(R) Extension for Scikit-learn in your code. You will not get an error if you do this. When you use algorithms or parameters not supported by the extension, the package fallbacks into original stock version of scikit-learn.
## ๐ Acceleration

Configurations:
- HW: c5.24xlarge AWS EC2 Instance using an Intel Xeon Platinum 8275CL with 2 sockets and 24 cores per socket
- SW: scikit-learn version 0.24.2, scikit-learn-intelex version 2021.2.3, Python 3.8
[Benchmarks code](https://github.com/IntelPython/scikit-learn_bench)
## ๐ Installation
[System Requirements](https://intel.github.io/scikit-learn-intelex/system-requirements.html) | [Install via pip or conda](https://github.com/intel/scikit-learn-intelex/blob/master/INSTALL.md) | [Build from sources](INSTALL.md#build-from-sources)
Intel(R) Extension for Scikit-learn is available at the [Python Package Index](https://pypi.org/project/scikit-learn-intelex/),
on Anaconda Cloud in [Conda-Forge channel](https://anaconda.org/conda-forge/scikit-learn-intelex) and in [Intel channel](https://anaconda.org/intel/scikit-learn-intelex). You can also build the extension from [sources](INSTALL.md#build-from-sources).
The extension is also available as a part of [Intelยฎ oneAPI AI Analytics Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/ai-analytics-toolkit.html)โฏ(AI Kit). If you already have AI Kit installed, you do not need to install the extension.
Installation via `pip` package manager is recommended by default:
```bash
pip install scikit-learn-intelex
```
## ๐ Important Links
- [Notebook examples](https://github.com/intel/scikit-learn-intelex/tree/master/examples/notebooks)
- [Documentation](https://intel.github.io/scikit-learn-intelex/)
- [Supported algorithms and parameters](https://intel.github.io/scikit-learn-intelex/algorithms.html)
- [Machine Learning Benchmarks](https://github.com/IntelPython/scikit-learn_bench)
## ๐ Follow us on Medium
We publish blogs on Medium, so [follow us](https://medium.com/intel-analytics-software/tagged/machine-learning) to learn tips and tricks for more efficient data analysis with the help of Intel(R) Extension for Scikit-learn. Here are our latest blogs:
- [Save Time and Money with Intel Extension for Scikit-learn](https://medium.com/intel-analytics-software/save-time-and-money-with-intel-extension-for-scikit-learn-33627425ae4)
- [Superior Machine Learning Performance on the Latest Intel Xeon Scalable Processors](https://medium.com/intel-analytics-software/superior-machine-learning-performance-on-the-latest-intel-xeon-scalable-processor-efdec279f5a3)
- [Leverage Intel Optimizations in Scikit-Learn](https://medium.com/intel-analytics-software/leverage-intel-optimizations-in-scikit-learn-f562cb9d5544)
- [Intel Gives Scikit-Learn the Performance Boost Data Scientists Need](https://medium.com/intel-analytics-software/intel-gives-scikit-learn-the-performance-boost-data-scientists-need-42eb47c80b18)
- [From Hours to Minutes: 600x Faster SVM](https://medium.com/intel-analytics-software/from-hours-to-minutes-600x-faster-svm-647f904c31ae)
- [Improve the Performance of XGBoost and LightGBM Inference](https://medium.com/intel-analytics-software/improving-the-performance-of-xgboost-and-lightgbm-inference-3b542c03447e)
- [Accelerate Kaggle Challenges Using Intel AI Analytics Toolkit](https://medium.com/intel-analytics-software/accelerate-kaggle-challenges-using-intel-ai-analytics-toolkit-beb148f66d5a)
- [Accelerate Your scikit-learn Applications](https://medium.com/intel-analytics-software/improving-the-performance-of-xgboost-and-lightgbm-inference-3b542c03447e)
- [Accelerate Linear Models for Machine Learning](https://medium.com/intel-analytics-software/accelerating-linear-models-for-machine-learning-5a75ff50a0fe)
- [Accelerate K-Means Clustering](https://medium.com/intel-analytics-software/accelerate-k-means-clustering-6385088788a1)
## โ FAQ
[See answers to frequently asked questions]
### โ Are all algorithms affected by patching?
> No. The patching only affects [selected algorithms and their parameters](https://intel.github.io/scikit-learn-intelex/algorithms.html).
### โ What happens if I use parameters not supported by the extension?
> In cases when unsupported parameters are used, the package fallbacks into original stock version of scikit-learn. You will not get an error.
### โ What happens if I run algorithms not supported by the extension?
> If you use algorithms for which no optimizations are available, their original version from the stock scikit-learn is used.
### โ Can I see which implementation of the algorithm is currently used?
> Yes. To find out which implementation of the algorithm is currently used (Intel(R) Extension for Scikit-learn or original Scikit-learn), use the [verbose mode](https://intel.github.io/scikit-learn-intelex/verbose.html).
### โ How much faster scikit-learn is after the patching?
> We compare the performance of Intel(R) Extension for Scikit-Learn to other frameworks in [Machine Learning Benchmarks](https://github.com/IntelPython/scikit-learn_bench). Read [our blogs on Medium](#-follow-us-on-medium) if you are interested in the detailed comparison.
### โ What if the patching does not cover my scenario?
> If the patching does not cover your scenarios, [submit an issue on GitHub](https://github.com/intel/scikit-learn-intelex/issues) with the description of what you would want to have.
## ๐ฌ Support
Report issues, ask questions, and provide suggestions using:
- [GitHub Issues](https://github.com/intel/scikit-learn-intelex/issues)
- [GitHub Discussions](https://github.com/intel/scikit-learn-intelex/discussions)
- [Forum](https://community.intel.com/t5/Intel-Distribution-for-Python/bd-p/distribution-python)
You may reach out to project maintainers privately at onedal.maintainers@intel.com
## oneAPI
Intel(R) Extension for Scikit-learn is part of [oneAPI](https://oneapi.io) and [Intelยฎ oneAPI AI Analytics Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/ai-analytics-toolkit.html)โฏ(AI Kit).
## daalpy and oneDAL
The acceleration is achieved through the use of the Intel(R) oneAPI Data Analytics Library (oneDAL). Learn more:
- [About Intel(R) oneAPI Data Analytics Library](https://github.com/oneapi-src/oneDAL)
- [About daal4py](https://github.com/intel/scikit-learn-intelex/tree/master/daal4py)
---
โ ๏ธIntel(R) Extension for Scikit-learn contains scikit-learn patching functionality that was originally available in [**daal4py**](https://github.com/intel/scikit-learn-intelex/tree/master/daal4py) package. All future updates for the patches will be available only in Intel(R) Extension for Scikit-learn. We recommend you to use scikit-learn-intelex package instead of daal4py.
You can learn more about daal4py in [daal4py documentation](https://intelpython.github.io/daal4py).
---