Use global patching to patch all your scikit-learn applications without any additional actions.
Intel® Extension for Scikit-learn*
read and write permissions to Scikit-learn files
Patch all supported algorithms¶
To patch all supported algorithms, run:
python sklearnex.glob patch_sklearn
Patch selected algorithms¶
If you want to patch only some algorithms, use
with a list of algorithms to patch.
For example, to patch only SVC and RandomForestClassifier estimators, run:
python sklearnex.glob patch_sklearn -a svc random_forest_classifier
Disable patching notifications¶
If you do not want to receive patching notifications, then use
python sklearnex.glob patch_sklearn -a svc random_forest_classifier -nv
If you run the global patching command several times with different parameters, then only the last configuration will be applied.
Disable global patching¶
To disable global patching, use the following command:
python sklearnex.glob unpatch_sklearn
Enable global patching via code¶
You can also enable global patching in your code. To do this,
patch_sklearn function with the
from sklearnex import patch_sklearn patch_sklearn(global_patch=True) import sklearn
After that, Scikit-learn patches will be enabled in the current application and in all others that use the same environment.
Disable global patching via code¶
To disable global patching via code, use the
argument in the
from sklearnex import unpatch_sklearn unpatch_sklearn(global_patch=True)
If you clone an environment with enabled global patching, it will already be applied in the new environment.