scikit-learn-intelex 2025.10.0__py313-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/__init__.py +73 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/__main__.py +58 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/_daal4py.cp313-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/__init__.py +94 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/gbt_convertors.py +1199 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/logistic_regression_builders.py +211 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mb/tree_based_builders.py +425 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/mpi_transceiver.cp313-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/__init__.py +40 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/_n_jobs_support.py +252 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/_utils.py +245 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/dbscan.py +165 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/k_means.py +565 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/tests/test_dbscan.py +109 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/decomposition/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/decomposition/_pca.py +528 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/AdaBoostClassifier.py +192 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/GBTDAAL.py +333 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/_forest.py +1285 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/tests/test_decision_forest.py +206 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_coordinate_descent.py +826 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_linear.py +269 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_ridge.py +290 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/coordinate_descent.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/linear.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_loss.py +195 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_path.py +561 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/ridge.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_enet.py +157 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_linear.py +198 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_ridge.py +69 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/manifold/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/manifold/_t_sne.py +432 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_pairwise.py +259 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_ranking.py +210 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/_split.py +309 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/tests/test_split.py +56 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/__init__.py +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/dispatcher.py +232 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/_models_info.py +164 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/test_monkeypatch.py +71 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/test_patching.py +90 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/utils/_launch_algorithms.py +117 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/__init__.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_base.py +493 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_classification.py +136 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_regression.py +72 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_unsupervised.py +55 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/tests/test_kneighbors.py +113 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/svm/svm.py +736 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/__init__.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/base.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/tests/test_utils.py +51 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/daal4py/sklearn/utils/validation.py +772 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/__init__.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_config.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_device_offload.py +199 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_onedal_py_dpc.cp313-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/_onedal_py_host.cp313-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/basic_statistics.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/incremental_basic_statistics.py +165 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_basic_statistics.py +241 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_incremental_basic_statistics.py +279 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/utils.py +50 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/dbscan.py +80 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/kmeans.py +582 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/kmeans_init.py +145 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_dbscan.py +125 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans.py +88 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans_init.py +93 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_backend.py +258 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_estimator_checks.py +47 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/_mixin.py +62 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/hyperparameters.py +148 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/common/tests/test_sycl.py +148 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/covariance.py +121 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/incremental_covariance.py +151 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/tests/test_covariance.py +50 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/covariance/tests/test_incremental_covariance.py +190 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_data_conversion.py +158 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_dlpack.py +64 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/_sycl_usm.py +63 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/tests/common.py +131 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/datatypes/tests/test_data.py +686 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/incremental_pca.py +218 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/pca.py +124 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/decomposition/tests/test_incremental_pca.py +291 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/dummy/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/dummy/dummy.py +137 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/forest.py +781 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/ensemble/tests/test_random_forest.py +97 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/incremental_linear_model.py +201 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/linear_model.py +230 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/logistic_regression.py +293 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_linear_regression.py +213 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_ridge_regression.py +171 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_linear_regression.py +252 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_logistic_regression.py +95 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_ridge.py +95 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/neighbors/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/neighbors/neighbors.py +690 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/neighbors/tests/test_knn_classification.py +49 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/get_tree.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/kernel_functions.py +202 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/primitives/tests/test_kernel_functions.py +159 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/svm.py +592 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_csr_svm.py +352 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvc.py +204 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvr.py +210 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_svc.py +168 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/svm/tests/test_svr.py +243 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/test_common.py +71 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/utils/_dataframes_support.py +179 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/tests/utils/_device_selection.py +94 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_array_api.py +98 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_sycl_queue_manager.py +213 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/_third_party.py +220 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/tests/test_validation.py +142 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/onedal/utils/validation.py +503 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/__init__.py +69 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/__main__.py +58 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_config.py +163 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_device_offload.py +205 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/_utils.py +219 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/base.py +109 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/basic_statistics.py +241 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/incremental_basic_statistics.py +338 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_basic_statistics.py +405 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +455 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/dbscan.py +199 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/k_means.py +399 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_dbscan.py +38 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_kmeans.py +157 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/conftest.py +82 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/covariance/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/covariance/incremental_covariance.py +440 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/covariance/tests/test_incremental_covariance.py +307 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/decomposition/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/decomposition/pca.py +558 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/decomposition/tests/test_pca.py +164 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dispatcher.py +572 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/doc/third-party-programs.txt +629 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/_dummy.py +615 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/dummy/tests/test_dummy.py +62 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/ensemble/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/ensemble/_forest.py +1799 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/ensemble/tests/test_forest.py +196 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/glob/__main__.py +72 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/glob/dispatcher.py +101 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/__init__.py +32 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/coordinate_descent.py +44 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_linear.py +427 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_ridge.py +407 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/linear.py +363 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/logistic_regression.py +466 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/ridge.py +407 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_linear.py +267 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_ridge.py +214 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_linear.py +167 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_logreg.py +565 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_ridge.py +256 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/manifold/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/manifold/t_sne.py +28 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/manifold/tests/test_tsne.py +256 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/metrics/__init__.py +23 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/metrics/pairwise.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/metrics/ranking.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/metrics/tests/test_metrics.py +39 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/model_selection/__init__.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/model_selection/split.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/model_selection/tests/test_model_selection.py +34 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/__init__.py +27 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/_lof.py +189 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/common.py +313 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/knn_classification.py +189 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/knn_regression.py +167 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/knn_unsupervised.py +170 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/neighbors/tests/test_neighbors.py +82 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/__init__.py +17 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/covariance/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/covariance/covariance.py +261 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/covariance/tests/test_covariance.py +112 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/incremental_pca.py +406 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/tests/test_incremental_pca.py +390 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/__init__.py +25 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/basic_statistics.py +24 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/incremental_basic_statistics.py +30 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +117 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_incremental_basic_statistics_spmd.py +314 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/__init__.py +30 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/dbscan.py +26 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/kmeans.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_dbscan_spmd.py +108 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_kmeans_spmd.py +180 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/covariance.py +24 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/incremental_covariance.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_covariance_spmd.py +120 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_incremental_covariance_spmd.py +200 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/__init__.py +20 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/incremental_pca.py +23 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/pca.py +23 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_incremental_pca_spmd.py +276 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_pca_spmd.py +146 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/forest.py +299 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/tests/test_forest_spmd.py +299 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/__init__.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/incremental_linear_model.py +28 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/linear_model.py +24 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/logistic_regression.py +21 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_incremental_linear_spmd.py +345 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +162 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py +169 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/__init__.py +23 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +433 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/__init__.py +29 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/_common.py +403 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/nusvc.py +278 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/nusvr.py +158 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/svc.py +306 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/svr.py +155 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/svm/tests/test_svm.py +124 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_common.py +607 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_config.py +256 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_hyperparameters.py +111 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_memory_usage.py +335 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_monkeypatch.py +269 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_n_jobs_support.py +111 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_parallel.py +48 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_patching.py +418 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/test_run_to_run_stability.py +335 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/__init__.py +48 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/base.py +420 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/tests/utils/spmd.py +198 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/__init__.py +19 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/_array_api.py +217 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/class_weight.py +100 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/parallel.py +97 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/tests/test_class_weight.py +69 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/tests/test_validation.py +238 -0
- scikit_learn_intelex-2025.10.0.data/data/Lib/site-packages/sklearnex/utils/validation.py +212 -0
- scikit_learn_intelex-2025.10.0.dist-info/LICENSE.txt +202 -0
- scikit_learn_intelex-2025.10.0.dist-info/METADATA +182 -0
- scikit_learn_intelex-2025.10.0.dist-info/RECORD +267 -0
- scikit_learn_intelex-2025.10.0.dist-info/WHEEL +5 -0
- scikit_learn_intelex-2025.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2021 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
|
+
import numpy as np
|
|
18
|
+
from sklearn.svm import NuSVR as _sklearn_NuSVR
|
|
19
|
+
from sklearn.utils.validation import (
|
|
20
|
+
_deprecate_positional_args,
|
|
21
|
+
check_array,
|
|
22
|
+
check_is_fitted,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
from daal4py.sklearn._n_jobs_support import control_n_jobs
|
|
26
|
+
from daal4py.sklearn._utils import sklearn_check_version
|
|
27
|
+
from onedal.svm import NuSVR as onedal_NuSVR
|
|
28
|
+
|
|
29
|
+
from .._device_offload import dispatch, wrap_output_data
|
|
30
|
+
from ..utils.validation import validate_data
|
|
31
|
+
from ._common import BaseSVR
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@control_n_jobs(decorated_methods=["fit", "predict", "score"])
|
|
35
|
+
class NuSVR(BaseSVR, _sklearn_NuSVR):
|
|
36
|
+
__doc__ = _sklearn_NuSVR.__doc__
|
|
37
|
+
|
|
38
|
+
if sklearn_check_version("1.2"):
|
|
39
|
+
_parameter_constraints: dict = {**_sklearn_NuSVR._parameter_constraints}
|
|
40
|
+
|
|
41
|
+
@_deprecate_positional_args
|
|
42
|
+
def __init__(
|
|
43
|
+
self,
|
|
44
|
+
*,
|
|
45
|
+
nu=0.5,
|
|
46
|
+
C=1.0,
|
|
47
|
+
kernel="rbf",
|
|
48
|
+
degree=3,
|
|
49
|
+
gamma="scale",
|
|
50
|
+
coef0=0.0,
|
|
51
|
+
shrinking=True,
|
|
52
|
+
tol=1e-3,
|
|
53
|
+
cache_size=200,
|
|
54
|
+
verbose=False,
|
|
55
|
+
max_iter=-1,
|
|
56
|
+
):
|
|
57
|
+
super().__init__(
|
|
58
|
+
kernel=kernel,
|
|
59
|
+
degree=degree,
|
|
60
|
+
gamma=gamma,
|
|
61
|
+
coef0=coef0,
|
|
62
|
+
tol=tol,
|
|
63
|
+
C=C,
|
|
64
|
+
nu=nu,
|
|
65
|
+
shrinking=shrinking,
|
|
66
|
+
cache_size=cache_size,
|
|
67
|
+
verbose=verbose,
|
|
68
|
+
max_iter=max_iter,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def fit(self, X, y, sample_weight=None):
|
|
72
|
+
if sklearn_check_version("1.2"):
|
|
73
|
+
self._validate_params()
|
|
74
|
+
elif self.nu <= 0 or self.nu > 1:
|
|
75
|
+
# else if added to correct issues with
|
|
76
|
+
# sklearn tests:
|
|
77
|
+
# svm/tests/test_sparse.py::test_error
|
|
78
|
+
# svm/tests/test_svm.py::test_bad_input
|
|
79
|
+
# for sklearn versions < 1.2 (i.e. without
|
|
80
|
+
# validate_params parameter checking)
|
|
81
|
+
# Without this, a segmentation fault with
|
|
82
|
+
# Windows fatal exception: access violation
|
|
83
|
+
# occurs
|
|
84
|
+
raise ValueError("nu <= 0 or nu > 1")
|
|
85
|
+
dispatch(
|
|
86
|
+
self,
|
|
87
|
+
"fit",
|
|
88
|
+
{
|
|
89
|
+
"onedal": self.__class__._onedal_fit,
|
|
90
|
+
"sklearn": _sklearn_NuSVR.fit,
|
|
91
|
+
},
|
|
92
|
+
X,
|
|
93
|
+
y,
|
|
94
|
+
sample_weight=sample_weight,
|
|
95
|
+
)
|
|
96
|
+
return self
|
|
97
|
+
|
|
98
|
+
@wrap_output_data
|
|
99
|
+
def predict(self, X):
|
|
100
|
+
check_is_fitted(self)
|
|
101
|
+
return dispatch(
|
|
102
|
+
self,
|
|
103
|
+
"predict",
|
|
104
|
+
{
|
|
105
|
+
"onedal": self.__class__._onedal_predict,
|
|
106
|
+
"sklearn": _sklearn_NuSVR.predict,
|
|
107
|
+
},
|
|
108
|
+
X,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@wrap_output_data
|
|
112
|
+
def score(self, X, y, sample_weight=None):
|
|
113
|
+
check_is_fitted(self)
|
|
114
|
+
return dispatch(
|
|
115
|
+
self,
|
|
116
|
+
"score",
|
|
117
|
+
{
|
|
118
|
+
"onedal": self.__class__._onedal_score,
|
|
119
|
+
"sklearn": _sklearn_NuSVR.score,
|
|
120
|
+
},
|
|
121
|
+
X,
|
|
122
|
+
y,
|
|
123
|
+
sample_weight=sample_weight,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def _onedal_fit(self, X, y, sample_weight=None, queue=None):
|
|
127
|
+
X, _, sample_weight = self._onedal_fit_checks(X, y, sample_weight)
|
|
128
|
+
onedal_params = {
|
|
129
|
+
"C": self.C,
|
|
130
|
+
"nu": self.nu,
|
|
131
|
+
"kernel": self.kernel,
|
|
132
|
+
"degree": self.degree,
|
|
133
|
+
"gamma": self._compute_gamma_sigma(X),
|
|
134
|
+
"coef0": self.coef0,
|
|
135
|
+
"tol": self.tol,
|
|
136
|
+
"shrinking": self.shrinking,
|
|
137
|
+
"cache_size": self.cache_size,
|
|
138
|
+
"max_iter": self.max_iter,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
self._onedal_estimator = onedal_NuSVR(**onedal_params)
|
|
142
|
+
self._onedal_estimator.fit(X, y, sample_weight, queue=queue)
|
|
143
|
+
self._save_attributes()
|
|
144
|
+
|
|
145
|
+
def _onedal_predict(self, X, queue=None):
|
|
146
|
+
X = validate_data(
|
|
147
|
+
self,
|
|
148
|
+
X,
|
|
149
|
+
dtype=[np.float64, np.float32],
|
|
150
|
+
ensure_all_finite=False,
|
|
151
|
+
accept_sparse="csr",
|
|
152
|
+
reset=False,
|
|
153
|
+
)
|
|
154
|
+
return self._onedal_estimator.predict(X, queue=queue)
|
|
155
|
+
|
|
156
|
+
fit.__doc__ = _sklearn_NuSVR.fit.__doc__
|
|
157
|
+
predict.__doc__ = _sklearn_NuSVR.predict.__doc__
|
|
158
|
+
score.__doc__ = _sklearn_NuSVR.score.__doc__
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2021 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
|
+
from functools import wraps
|
|
18
|
+
|
|
19
|
+
import numpy as np
|
|
20
|
+
from scipy import sparse as sp
|
|
21
|
+
from sklearn.exceptions import NotFittedError
|
|
22
|
+
from sklearn.metrics import accuracy_score
|
|
23
|
+
from sklearn.svm import SVC as _sklearn_SVC
|
|
24
|
+
from sklearn.utils.metaestimators import available_if
|
|
25
|
+
from sklearn.utils.validation import (
|
|
26
|
+
_deprecate_positional_args,
|
|
27
|
+
check_array,
|
|
28
|
+
check_is_fitted,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
from daal4py.sklearn._n_jobs_support import control_n_jobs
|
|
32
|
+
from daal4py.sklearn._utils import sklearn_check_version
|
|
33
|
+
from onedal.svm import SVC as onedal_SVC
|
|
34
|
+
|
|
35
|
+
from .._device_offload import dispatch, wrap_output_data
|
|
36
|
+
from .._utils import PatchingConditionsChain
|
|
37
|
+
from ..utils._array_api import get_namespace
|
|
38
|
+
from ..utils.validation import validate_data
|
|
39
|
+
from ._common import BaseSVC
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@control_n_jobs(
|
|
43
|
+
decorated_methods=["fit", "predict", "_predict_proba", "decision_function", "score"]
|
|
44
|
+
)
|
|
45
|
+
class SVC(BaseSVC, _sklearn_SVC):
|
|
46
|
+
__doc__ = _sklearn_SVC.__doc__
|
|
47
|
+
|
|
48
|
+
if sklearn_check_version("1.2"):
|
|
49
|
+
_parameter_constraints: dict = {**_sklearn_SVC._parameter_constraints}
|
|
50
|
+
|
|
51
|
+
@_deprecate_positional_args
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
*,
|
|
55
|
+
C=1.0,
|
|
56
|
+
kernel="rbf",
|
|
57
|
+
degree=3,
|
|
58
|
+
gamma="scale",
|
|
59
|
+
coef0=0.0,
|
|
60
|
+
shrinking=True,
|
|
61
|
+
probability=False,
|
|
62
|
+
tol=1e-3,
|
|
63
|
+
cache_size=200,
|
|
64
|
+
class_weight=None,
|
|
65
|
+
verbose=False,
|
|
66
|
+
max_iter=-1,
|
|
67
|
+
decision_function_shape="ovr",
|
|
68
|
+
break_ties=False,
|
|
69
|
+
random_state=None,
|
|
70
|
+
):
|
|
71
|
+
super().__init__(
|
|
72
|
+
C=C,
|
|
73
|
+
kernel=kernel,
|
|
74
|
+
degree=degree,
|
|
75
|
+
gamma=gamma,
|
|
76
|
+
coef0=coef0,
|
|
77
|
+
shrinking=shrinking,
|
|
78
|
+
probability=probability,
|
|
79
|
+
tol=tol,
|
|
80
|
+
cache_size=cache_size,
|
|
81
|
+
class_weight=class_weight,
|
|
82
|
+
verbose=verbose,
|
|
83
|
+
max_iter=max_iter,
|
|
84
|
+
decision_function_shape=decision_function_shape,
|
|
85
|
+
break_ties=break_ties,
|
|
86
|
+
random_state=random_state,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def fit(self, X, y, sample_weight=None):
|
|
90
|
+
if sklearn_check_version("1.2"):
|
|
91
|
+
self._validate_params()
|
|
92
|
+
elif self.C <= 0:
|
|
93
|
+
# else if added to correct issues with
|
|
94
|
+
# sklearn tests:
|
|
95
|
+
# svm/tests/test_sparse.py::test_error
|
|
96
|
+
# svm/tests/test_svm.py::test_bad_input
|
|
97
|
+
# for sklearn versions < 1.2 (i.e. without
|
|
98
|
+
# validate_params parameter checking)
|
|
99
|
+
# Without this, a segmentation fault with
|
|
100
|
+
# Windows fatal exception: access violation
|
|
101
|
+
# occurs
|
|
102
|
+
raise ValueError("C <= 0")
|
|
103
|
+
dispatch(
|
|
104
|
+
self,
|
|
105
|
+
"fit",
|
|
106
|
+
{
|
|
107
|
+
"onedal": self.__class__._onedal_fit,
|
|
108
|
+
"sklearn": _sklearn_SVC.fit,
|
|
109
|
+
},
|
|
110
|
+
X,
|
|
111
|
+
y,
|
|
112
|
+
sample_weight=sample_weight,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
return self
|
|
116
|
+
|
|
117
|
+
@wrap_output_data
|
|
118
|
+
def predict(self, X):
|
|
119
|
+
check_is_fitted(self)
|
|
120
|
+
return dispatch(
|
|
121
|
+
self,
|
|
122
|
+
"predict",
|
|
123
|
+
{
|
|
124
|
+
"onedal": self.__class__._onedal_predict,
|
|
125
|
+
"sklearn": _sklearn_SVC.predict,
|
|
126
|
+
},
|
|
127
|
+
X,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
@wrap_output_data
|
|
131
|
+
def score(self, X, y, sample_weight=None):
|
|
132
|
+
check_is_fitted(self)
|
|
133
|
+
return dispatch(
|
|
134
|
+
self,
|
|
135
|
+
"score",
|
|
136
|
+
{
|
|
137
|
+
"onedal": self.__class__._onedal_score,
|
|
138
|
+
"sklearn": _sklearn_SVC.score,
|
|
139
|
+
},
|
|
140
|
+
X,
|
|
141
|
+
y,
|
|
142
|
+
sample_weight=sample_weight,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
@available_if(_sklearn_SVC._check_proba)
|
|
146
|
+
@wraps(_sklearn_SVC.predict_proba, assigned=["__doc__"])
|
|
147
|
+
def predict_proba(self, X):
|
|
148
|
+
check_is_fitted(self)
|
|
149
|
+
return self._predict_proba(X)
|
|
150
|
+
|
|
151
|
+
@available_if(_sklearn_SVC._check_proba)
|
|
152
|
+
@wraps(_sklearn_SVC.predict_log_proba, assigned=["__doc__"])
|
|
153
|
+
def predict_log_proba(self, X):
|
|
154
|
+
xp, _ = get_namespace(X)
|
|
155
|
+
|
|
156
|
+
return xp.log(self.predict_proba(X))
|
|
157
|
+
|
|
158
|
+
@wrap_output_data
|
|
159
|
+
def _predict_proba(self, X):
|
|
160
|
+
return dispatch(
|
|
161
|
+
self,
|
|
162
|
+
"predict_proba",
|
|
163
|
+
{
|
|
164
|
+
"onedal": self.__class__._onedal_predict_proba,
|
|
165
|
+
"sklearn": _sklearn_SVC.predict_proba,
|
|
166
|
+
},
|
|
167
|
+
X,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
@wrap_output_data
|
|
171
|
+
def decision_function(self, X):
|
|
172
|
+
check_is_fitted(self)
|
|
173
|
+
return dispatch(
|
|
174
|
+
self,
|
|
175
|
+
"decision_function",
|
|
176
|
+
{
|
|
177
|
+
"onedal": self.__class__._onedal_decision_function,
|
|
178
|
+
"sklearn": _sklearn_SVC.decision_function,
|
|
179
|
+
},
|
|
180
|
+
X,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
decision_function.__doc__ = _sklearn_SVC.decision_function.__doc__
|
|
184
|
+
|
|
185
|
+
def _onedal_gpu_supported(self, method_name, *data):
|
|
186
|
+
class_name = self.__class__.__name__
|
|
187
|
+
patching_status = PatchingConditionsChain(
|
|
188
|
+
f"sklearn.svm.{class_name}.{method_name}"
|
|
189
|
+
)
|
|
190
|
+
if len(data) > 1:
|
|
191
|
+
self._class_count = len(np.unique(data[1]))
|
|
192
|
+
self._is_sparse = sp.issparse(data[0])
|
|
193
|
+
conditions = [
|
|
194
|
+
(
|
|
195
|
+
self.kernel in ["linear", "rbf"],
|
|
196
|
+
f'Kernel is "{self.kernel}" while '
|
|
197
|
+
'"linear" and "rbf" are only supported on GPU.',
|
|
198
|
+
),
|
|
199
|
+
(self.class_weight is None, "Class weight is not supported on GPU."),
|
|
200
|
+
(not self._is_sparse, "Sparse input is not supported on GPU."),
|
|
201
|
+
(self._class_count == 2, "Multiclassification is not supported on GPU."),
|
|
202
|
+
]
|
|
203
|
+
if method_name == "fit":
|
|
204
|
+
patching_status.and_conditions(conditions)
|
|
205
|
+
return patching_status
|
|
206
|
+
if method_name in ["predict", "predict_proba", "decision_function", "score"]:
|
|
207
|
+
conditions.append(
|
|
208
|
+
(hasattr(self, "_onedal_estimator"), "oneDAL model was not trained")
|
|
209
|
+
)
|
|
210
|
+
patching_status.and_conditions(conditions)
|
|
211
|
+
return patching_status
|
|
212
|
+
raise RuntimeError(f"Unknown method {method_name} in {class_name}")
|
|
213
|
+
|
|
214
|
+
def _get_sample_weight(self, X, y, sample_weight=None):
|
|
215
|
+
sample_weight = super()._get_sample_weight(X, y, sample_weight)
|
|
216
|
+
if sample_weight is None:
|
|
217
|
+
return sample_weight
|
|
218
|
+
|
|
219
|
+
if np.any(sample_weight <= 0) and len(np.unique(y[sample_weight > 0])) != len(
|
|
220
|
+
self.classes_
|
|
221
|
+
):
|
|
222
|
+
raise ValueError(
|
|
223
|
+
"Invalid input - all samples with positive weights "
|
|
224
|
+
"belong to the same class"
|
|
225
|
+
if sklearn_check_version("1.2")
|
|
226
|
+
else "Invalid input - all samples with positive weights "
|
|
227
|
+
"have the same label."
|
|
228
|
+
)
|
|
229
|
+
return sample_weight
|
|
230
|
+
|
|
231
|
+
def _onedal_fit(self, X, y, sample_weight=None, queue=None):
|
|
232
|
+
X, _, weights = self._onedal_fit_checks(X, y, sample_weight)
|
|
233
|
+
onedal_params = {
|
|
234
|
+
"C": self.C,
|
|
235
|
+
"kernel": self.kernel,
|
|
236
|
+
"degree": self.degree,
|
|
237
|
+
"gamma": self._compute_gamma_sigma(X),
|
|
238
|
+
"coef0": self.coef0,
|
|
239
|
+
"tol": self.tol,
|
|
240
|
+
"shrinking": self.shrinking,
|
|
241
|
+
"cache_size": self.cache_size,
|
|
242
|
+
"max_iter": self.max_iter,
|
|
243
|
+
"class_weight": self.class_weight,
|
|
244
|
+
"break_ties": self.break_ties,
|
|
245
|
+
"decision_function_shape": self.decision_function_shape,
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
self._onedal_estimator = onedal_SVC(**onedal_params)
|
|
249
|
+
self._onedal_estimator.fit(X, y, weights, queue=queue)
|
|
250
|
+
|
|
251
|
+
if self.probability:
|
|
252
|
+
self._fit_proba(
|
|
253
|
+
X,
|
|
254
|
+
y,
|
|
255
|
+
sample_weight=sample_weight,
|
|
256
|
+
queue=queue,
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
self._save_attributes()
|
|
260
|
+
|
|
261
|
+
def _onedal_predict(self, X, queue=None):
|
|
262
|
+
X = validate_data(
|
|
263
|
+
self,
|
|
264
|
+
X,
|
|
265
|
+
dtype=[np.float64, np.float32],
|
|
266
|
+
ensure_all_finite=False,
|
|
267
|
+
ensure_2d=False,
|
|
268
|
+
accept_sparse="csr",
|
|
269
|
+
reset=False,
|
|
270
|
+
)
|
|
271
|
+
return self._onedal_estimator.predict(X, queue=queue)
|
|
272
|
+
|
|
273
|
+
def _onedal_predict_proba(self, X, queue=None):
|
|
274
|
+
if getattr(self, "clf_prob", None) is None:
|
|
275
|
+
raise NotFittedError(
|
|
276
|
+
"predict_proba is not available when fitted with probability=False"
|
|
277
|
+
)
|
|
278
|
+
from .._config import config_context, get_config
|
|
279
|
+
|
|
280
|
+
# We use stock metaestimators below, so the only way
|
|
281
|
+
# to pass a queue is using config_context.
|
|
282
|
+
cfg = get_config()
|
|
283
|
+
cfg["target_offload"] = queue
|
|
284
|
+
with config_context(**cfg):
|
|
285
|
+
return self.clf_prob.predict_proba(X)
|
|
286
|
+
|
|
287
|
+
def _onedal_decision_function(self, X, queue=None):
|
|
288
|
+
X = validate_data(
|
|
289
|
+
self,
|
|
290
|
+
X,
|
|
291
|
+
dtype=[np.float64, np.float32],
|
|
292
|
+
ensure_all_finite=False,
|
|
293
|
+
accept_sparse="csr",
|
|
294
|
+
reset=False,
|
|
295
|
+
)
|
|
296
|
+
return self._onedal_estimator.decision_function(X, queue=queue)
|
|
297
|
+
|
|
298
|
+
def _onedal_score(self, X, y, sample_weight=None, queue=None):
|
|
299
|
+
return accuracy_score(
|
|
300
|
+
y, self._onedal_predict(X, queue=queue), sample_weight=sample_weight
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
fit.__doc__ = _sklearn_SVC.fit.__doc__
|
|
304
|
+
predict.__doc__ = _sklearn_SVC.predict.__doc__
|
|
305
|
+
decision_function.__doc__ = _sklearn_SVC.decision_function.__doc__
|
|
306
|
+
score.__doc__ = _sklearn_SVC.score.__doc__
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2021 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
|
+
import numpy as np
|
|
18
|
+
from sklearn.svm import SVR as _sklearn_SVR
|
|
19
|
+
from sklearn.utils.validation import _deprecate_positional_args, check_is_fitted
|
|
20
|
+
|
|
21
|
+
from daal4py.sklearn._n_jobs_support import control_n_jobs
|
|
22
|
+
from daal4py.sklearn._utils import sklearn_check_version
|
|
23
|
+
from onedal.svm import SVR as onedal_SVR
|
|
24
|
+
|
|
25
|
+
from .._device_offload import dispatch, wrap_output_data
|
|
26
|
+
from ..utils.validation import validate_data
|
|
27
|
+
from ._common import BaseSVR
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@control_n_jobs(decorated_methods=["fit", "predict", "score"])
|
|
31
|
+
class SVR(BaseSVR, _sklearn_SVR):
|
|
32
|
+
__doc__ = _sklearn_SVR.__doc__
|
|
33
|
+
|
|
34
|
+
if sklearn_check_version("1.2"):
|
|
35
|
+
_parameter_constraints: dict = {**_sklearn_SVR._parameter_constraints}
|
|
36
|
+
|
|
37
|
+
@_deprecate_positional_args
|
|
38
|
+
def __init__(
|
|
39
|
+
self,
|
|
40
|
+
*,
|
|
41
|
+
kernel="rbf",
|
|
42
|
+
degree=3,
|
|
43
|
+
gamma="scale",
|
|
44
|
+
coef0=0.0,
|
|
45
|
+
tol=1e-3,
|
|
46
|
+
C=1.0,
|
|
47
|
+
epsilon=0.1,
|
|
48
|
+
shrinking=True,
|
|
49
|
+
cache_size=200,
|
|
50
|
+
verbose=False,
|
|
51
|
+
max_iter=-1,
|
|
52
|
+
):
|
|
53
|
+
super().__init__(
|
|
54
|
+
kernel=kernel,
|
|
55
|
+
degree=degree,
|
|
56
|
+
gamma=gamma,
|
|
57
|
+
coef0=coef0,
|
|
58
|
+
tol=tol,
|
|
59
|
+
C=C,
|
|
60
|
+
epsilon=epsilon,
|
|
61
|
+
shrinking=shrinking,
|
|
62
|
+
cache_size=cache_size,
|
|
63
|
+
verbose=verbose,
|
|
64
|
+
max_iter=max_iter,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def fit(self, X, y, sample_weight=None):
|
|
68
|
+
if sklearn_check_version("1.2"):
|
|
69
|
+
self._validate_params()
|
|
70
|
+
elif self.C <= 0:
|
|
71
|
+
# else if added to correct issues with
|
|
72
|
+
# sklearn tests:
|
|
73
|
+
# svm/tests/test_sparse.py::test_error
|
|
74
|
+
# svm/tests/test_svm.py::test_bad_input
|
|
75
|
+
# for sklearn versions < 1.2 (i.e. without
|
|
76
|
+
# validate_params parameter checking)
|
|
77
|
+
# Without this, a segmentation fault with
|
|
78
|
+
# Windows fatal exception: access violation
|
|
79
|
+
# occurs
|
|
80
|
+
raise ValueError("C <= 0")
|
|
81
|
+
dispatch(
|
|
82
|
+
self,
|
|
83
|
+
"fit",
|
|
84
|
+
{
|
|
85
|
+
"onedal": self.__class__._onedal_fit,
|
|
86
|
+
"sklearn": _sklearn_SVR.fit,
|
|
87
|
+
},
|
|
88
|
+
X,
|
|
89
|
+
y,
|
|
90
|
+
sample_weight=sample_weight,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return self
|
|
94
|
+
|
|
95
|
+
@wrap_output_data
|
|
96
|
+
def predict(self, X):
|
|
97
|
+
check_is_fitted(self)
|
|
98
|
+
return dispatch(
|
|
99
|
+
self,
|
|
100
|
+
"predict",
|
|
101
|
+
{
|
|
102
|
+
"onedal": self.__class__._onedal_predict,
|
|
103
|
+
"sklearn": _sklearn_SVR.predict,
|
|
104
|
+
},
|
|
105
|
+
X,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
@wrap_output_data
|
|
109
|
+
def score(self, X, y, sample_weight=None):
|
|
110
|
+
check_is_fitted(self)
|
|
111
|
+
return dispatch(
|
|
112
|
+
self,
|
|
113
|
+
"score",
|
|
114
|
+
{
|
|
115
|
+
"onedal": self.__class__._onedal_score,
|
|
116
|
+
"sklearn": _sklearn_SVR.score,
|
|
117
|
+
},
|
|
118
|
+
X,
|
|
119
|
+
y,
|
|
120
|
+
sample_weight=sample_weight,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
def _onedal_fit(self, X, y, sample_weight=None, queue=None):
|
|
124
|
+
X, _, sample_weight = self._onedal_fit_checks(X, y, sample_weight)
|
|
125
|
+
onedal_params = {
|
|
126
|
+
"C": self.C,
|
|
127
|
+
"epsilon": self.epsilon,
|
|
128
|
+
"kernel": self.kernel,
|
|
129
|
+
"degree": self.degree,
|
|
130
|
+
"gamma": self._compute_gamma_sigma(X),
|
|
131
|
+
"coef0": self.coef0,
|
|
132
|
+
"tol": self.tol,
|
|
133
|
+
"shrinking": self.shrinking,
|
|
134
|
+
"cache_size": self.cache_size,
|
|
135
|
+
"max_iter": self.max_iter,
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
self._onedal_estimator = onedal_SVR(**onedal_params)
|
|
139
|
+
self._onedal_estimator.fit(X, y, sample_weight, queue=queue)
|
|
140
|
+
self._save_attributes()
|
|
141
|
+
|
|
142
|
+
def _onedal_predict(self, X, queue=None):
|
|
143
|
+
X = validate_data(
|
|
144
|
+
self,
|
|
145
|
+
X,
|
|
146
|
+
dtype=[np.float64, np.float32],
|
|
147
|
+
ensure_all_finite=False,
|
|
148
|
+
accept_sparse="csr",
|
|
149
|
+
reset=False,
|
|
150
|
+
)
|
|
151
|
+
return self._onedal_estimator.predict(X, queue=queue)
|
|
152
|
+
|
|
153
|
+
fit.__doc__ = _sklearn_SVR.fit.__doc__
|
|
154
|
+
predict.__doc__ = _sklearn_SVR.predict.__doc__
|
|
155
|
+
score.__doc__ = _sklearn_SVR.score.__doc__
|