Package: scikit-learn-intelex
Intel(R) Extension for Scikit-learn*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!The acceleration is achieved through the use of the Intel(R) oneAPI Data Analytics Library (oneDAL). Patching scikit-learn makes it a well-suited machine learning framework for dealing with real-life problems.⚠️Intel(R) Extension for Scikit-learn contains scikit-learn patching functionality that was originally available indaal4pypackage. 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 indaal4py documentation.👀 Follow us on MediumWe publish blogs on Medium, sofollow usto 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-learnSuperior Machine Learning Performance on the Latest Intel Xeon Scalable ProcessorsLeverage Intel Optimizations in Scikit-LearnIntel Gives Scikit-Learn the Performance Boost Data Scientists NeedFrom Hours to Minutes: 600x Faster SVMImprove the Performance of XGBoost and LightGBM InferenceAccelerate Kaggle Challenges Using Intel AI Analytics ToolkitAccelerate Your scikit-learn ApplicationsAccelerate Linear Models for Machine LearningAccelerate K-Means Clustering🔗 Important linksNotebook examplesDocumentationscikit-learn API and patchingBenchmark codeBuilding from SourcesAbout Intel(R) oneAPI Data Analytics LibraryAbout Intel(R) daal4py💬 SupportReport issues, ask questions, and provide suggestions using:GitHub IssuesGitHub DiscussionsForumYou may reach out to project maintainers privately atonedal.maintainers@intel.com🛠 InstallationIntel(R) Extension for Scikit-learn is available at thePython Package Index,
on Anaconda Cloud inConda-Forge channeland inIntel channel.
Intel(R) Extension for Scikit-learn is also available as a part ofIntel® oneAPI AI Analytics Toolkit(AI Kit).PyPi (recommended by default)pipinstallscikit-learn-intelexAnaconda Cloud from Conda-Forge channel (recommended for conda users by default)condaconfig--addchannelsconda-forgecondaconfig--setchannel_prioritystrictcondainstallscikit-learn-intelexAnaconda Cloud from Intel channel (recommended for Intel® Distribution for Python users)condaconfig--addchannelsintelcondaconfig--setchannel_prioritystrictcondainstallscikit-learn-intelex[Click to expand] ℹ️ Supported configurations📦 PyPi channelOS / Python versionPython 3.8Python 3.9Python 3.10Python 3.11Python 3.12Linux[CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU]Windows[CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU]📦 Anaconda Cloud: Conda-Forge channelOS / Python versionPython 3.8Python 3.9Python 3.10Python 3.11Python 3.12Linux[CPU][CPU][CPU][CPU][CPU]Windows[CPU][CPU][CPU][CPU][CPU]📦 Anaconda Cloud: Intel channelOS / Python versionPython 3.8Python 3.9Python 3.10Python 3.11Python 3.12Linux[CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU]Windows[CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU][CPU, GPU]⚠️ Note:GPU support is an optional dependency. Required dependencies for GPU support
will not be downloaded. You need to manually installdpcpp_cpp_rtpackage.[Click to expand] ℹ️ How to install dpcpp_cpp_rt packagePyPipipinstall--upgradedpcpp_cpp_rtAnaconda Cloudcondainstalldpcpp_cpp_rt-cintelYou canbuild the package from sourcesas well.⚡️ Get StartedIntel CPU optimizations patchingimportnumpyasnpfromsklearneximportpatch_sklearnpatch_sklearn()fromsklearn.clusterimportDBSCANX=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)Intel GPU optimizations patchingimportnumpyasnpimportdpctlfromsklearneximportpatch_sklearn,config_contextpatch_sklearn()fromsklearn.clusterimportDBSCANX=np.array([[1.,2.],[2.,2.],[2.,3.],[8.,7.],[8.,8.],[25.,80.]],dtype=np.float32)withconfig_context(target_offload="gpu:0"):clustering=DBSCAN(eps=3,min_samples=2).fit(X)🚀 Scikit-learn patchingConfigurations:HW: c5.24xlarge AWS EC2 Instance using an Intel Xeon Platinum 8275CL with 2 sockets and 24 cores per socketSW: scikit-learn version 0.24.2, scikit-learn-intelex version 2021.2.3, Python 3.8Benchmarks code[Click to expand] ℹ️ Reproduce resultsWith Intel® Extension for Scikit-learn enabled:pythonrunner.py--configsconfigs/blogs/skl_conda_config.json-–reportWith the original Scikit-learn:pythonrunner.py--configsconfigs/blogs/skl_conda_config.json-–report--no-intel-optimizedIntel(R) Extension for Scikit-learn patching affects performance of specific Scikit-learn functionality. Refer to thelist of supported algorithms and parametersfor details. In cases when unsupported parameters are used, the package fallbacks into original Scikit-learn. If the patching does not cover your scenarios,submit an issue on GitHub.⚠️ We support optimizations for the last four versions of scikit-learn. The latest release of scikit-learn-intelex-2024.0.X supports scikit-learn 1.0.X, 1.1.X, 1.2.X and 1.3.X.📜 Intel(R) Extension for Scikit-learn verboseTo find out which implementation of the algorithm is currently used (Intel(R) Extension for Scikit-learn or original Scikit-learn), set the environment variable:On Linux:export SKLEARNEX_VERBOSE=INFOOn Windows:set SKLEARNEX_VERBOSE=INFOFor example, for DBSCAN you get one of these print statements depending on which implementation is used:SKLEARNEX INFO: sklearn.cluster.DBSCAN.fit: running accelerated version on CPUSKLEARNEX INFO: sklearn.cluster.DBSCAN.fit: fallback to original Scikit-learnRead more in the documentation.