|
| 1 | +.. ****************************************************************************** |
| 2 | +.. * Copyright 2024 Intel Corporation |
| 3 | +.. * |
| 4 | +.. * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +.. * you may not use this file except in compliance with the License. |
| 6 | +.. * You may obtain a copy of the License at |
| 7 | +.. * |
| 8 | +.. * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +.. * |
| 10 | +.. * Unless required by applicable law or agreed to in writing, software |
| 11 | +.. * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +.. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +.. * See the License for the specific language governing permissions and |
| 14 | +.. * limitations under the License. |
| 15 | +.. *******************************************************************************/ |
| 16 | +
|
| 17 | +.. _preview: |
| 18 | + |
| 19 | +##################### |
| 20 | +Preview Functionality |
| 21 | +##################### |
| 22 | + |
| 23 | +Some of implemented functionality in |intelex| doesn't meet one or few of next requirements |
| 24 | +for being enabled by default for all users: |
| 25 | + |
| 26 | +* The functionality API is not stable and can be changed in future |
| 27 | +* The functionality doesn't have full compatibility with stock Scikit-learn |
| 28 | +* The functionality misses performance targets compared to stock Scikit-learn or previously available version of functionality |
| 29 | +* The functionality is not fully tested |
| 30 | + |
| 31 | +This type of functionality is available under **preview mode** of |intelex| and located in |
| 32 | +the corresponding module (`sklearnex.preview`). |
| 33 | + |
| 34 | +Preview functionality *may* or *may not* participate in patching of Scikit-learn. |
| 35 | +For example, a preview estimator may be a replacement for a stock one or a completely new one. |
| 36 | + |
| 37 | +To enable preview functionality, you need to set the `SKLEARNEX_PREVIEW` environment variable |
| 38 | +to non-empty value before patching of Scikit-learn. |
| 39 | +For example, you can set the environment variable in the following way: |
| 40 | + |
| 41 | +- On Linux* OS :: |
| 42 | + |
| 43 | + export SKLEARNEX_PREVIEW=1 |
| 44 | + |
| 45 | +- On Windows* OS :: |
| 46 | + |
| 47 | + set SKLEARNEX_PREVIEW=1 |
| 48 | + |
| 49 | +Then, you can import Scikit-learn estimator patched with a preview one from `sklearnex.preview` module:: |
| 50 | + |
| 51 | + from sklearnex import patch_sklearn |
| 52 | + patch_sklearn() |
| 53 | + from sklearn.linear_model import Ridge |
| 54 | + print(Ridge.__module__) |
| 55 | + # output: |
| 56 | + # sklearnex.preview.linear_model.ridge |
| 57 | + |
| 58 | +Current list of preview estimators: |
| 59 | + |
| 60 | +.. list-table:: |
| 61 | + :widths: 30 20 10 |
| 62 | + :header-rows: 1 |
| 63 | + :align: left |
| 64 | + |
| 65 | + * - Estimator name |
| 66 | + - Module |
| 67 | + - Is patching supported |
| 68 | + * - EmpiricalCovariance |
| 69 | + - sklearnex.preview.covariance |
| 70 | + - Yes |
| 71 | + * - IncrementalPCA |
| 72 | + - sklearnex.preview.decomposition |
| 73 | + - Yes |
| 74 | + * - Ridge |
| 75 | + - sklearnex.preview.linear_model |
| 76 | + - Yes |
0 commit comments