scikit-learn-intelex 2024.1.0__py39-none-win_amd64.whl → 2025.1.0__py39-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.
Potentially problematic release.
This version of scikit-learn-intelex might be problematic. Click here for more details.
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/__init__.py +73 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/__main__.py +58 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/_daal4py.cp39-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/doc/third-party-programs.txt +424 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/mb/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/mb/model_builders.py +377 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/mpi_transceiver.cp39-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/__init__.py +40 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/_n_jobs_support.py +248 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/_utils.py +245 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/dbscan.py +165 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/k_means.py +597 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/cluster/tests/test_dbscan.py +109 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/cluster → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/decomposition}/__init__.py +3 -3
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/decomposition/_pca.py +524 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/AdaBoostClassifier.py +196 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/GBTDAAL.py +337 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/__init__.py +27 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/_forest.py +1397 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/ensemble/tests/test_decision_forest.py +206 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn}/linear_model/__init__.py +29 -29
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_coordinate_descent.py +848 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_linear.py +272 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/_ridge.py +325 -0
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/basic_statistics.py → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/coordinate_descent.py +2 -2
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/linear.py +17 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_loss.py +195 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/logistic_path.py +1026 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/ridge.py +17 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_linear.py +208 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/linear_model/tests/test_ridge.py +69 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/manifold}/__init__.py +4 -2
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/manifold/_t_sne.py +405 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_pairwise.py +236 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/metrics/_ranking.py +210 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/_split.py +309 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/model_selection/tests/test_split.py +56 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/__init__.py +0 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/dispatcher.py +232 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch}/tests/_models_info.py +13 -22
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch/tests/test_monkeypatch.py +71 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch}/tests/test_patching.py +10 -42
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/monkeypatch}/tests/utils/_launch_algorithms.py +4 -5
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/__init__.py +21 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_base.py +503 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_classification.py +139 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_regression.py +74 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/_unsupervised.py +55 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/neighbors/tests/test_kneighbors.py +113 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/svm/svm.py +734 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/utils/__init__.py +21 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/utils/base.py +75 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/utils/tests/test_utils.py +51 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/daal4py/sklearn/utils/validation.py +693 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/__init__.py +83 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/_config.py +54 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/_device_offload.py +222 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/_onedal_py_dpc.cp39-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/_onedal_py_host.cp39-win_amd64.pyd +0 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/basic_statistics/basic_statistics.py +107 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/basic_statistics/incremental_basic_statistics.py +160 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_basic_statistics.py +298 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/basic_statistics/tests/test_incremental_basic_statistics.py +196 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/__init__.py +27 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/dbscan.py +110 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/kmeans.py +564 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/kmeans_init.py +115 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/tests/test_dbscan.py +125 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans.py +88 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/cluster/tests/test_kmeans_init.py +93 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/_base.py +38 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/_estimator_checks.py +47 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/_mixin.py +62 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/_policy.py +59 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/_spmd_policy.py +30 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/hyperparameters.py +125 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/common/tests/test_policy.py +76 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/linear_model → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/covariance}/__init__.py +3 -2
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/covariance/covariance.py +125 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/covariance/incremental_covariance.py +146 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/covariance/tests/test_covariance.py +50 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/covariance/tests/test_incremental_covariance.py +122 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/datatypes/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/datatypes/_data_conversion.py +154 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/datatypes/tests/common.py +126 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/datatypes/tests/test_data.py +414 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/decomposition}/__init__.py +3 -2
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/decomposition/incremental_pca.py +204 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/decomposition/pca.py +186 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/decomposition/tests/test_incremental_pca.py +198 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/ensemble/__init__.py +29 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/ensemble/forest.py +727 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/ensemble/tests/test_random_forest.py +97 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/__init__.py +27 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/incremental_linear_model.py +258 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/linear_model.py +329 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/logistic_regression.py +249 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_linear_regression.py +168 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_incremental_ridge_regression.py +107 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_linear_regression.py +250 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_logistic_regression.py +95 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/linear_model/tests/test_ridge.py +95 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/neighbors/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/neighbors/neighbors.py +767 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/neighbors/tests/test_knn_classification.py +49 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/primitives/__init__.py +27 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/primitives/get_tree.py +25 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/primitives/kernel_functions.py +153 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/primitives/tests/test_kernel_functions.py +159 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/svm.py +556 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/tests/test_csr_svm.py +351 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvc.py +204 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/tests/test_nusvr.py +210 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/tests/test_svc.py +176 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/svm/tests/test_svr.py +243 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/tests/test_common.py +57 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/tests/utils/_dataframes_support.py +162 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/tests/utils/_device_selection.py +102 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/utils/__init__.py +49 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/utils/_array_api.py +81 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/utils/_dpep_helpers.py +56 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/onedal/utils/validation.py +440 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/__init__.py +10 -7
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/_config.py +22 -16
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/_device_offload.py +126 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/_utils.py +27 -4
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/basic_statistics.py +230 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/incremental_basic_statistics.py +345 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_basic_statistics.py +270 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +404 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/cluster/__init__.py +1 -1
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/cluster/dbscan.py +19 -10
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/cluster/k_means.py +395 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/cluster/tests/test_dbscan.py +8 -6
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_kmeans.py +159 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/conftest.py +82 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/covariance/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/covariance/incremental_covariance.py +398 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/covariance/tests/test_incremental_covariance.py +237 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/decomposition/pca.py +425 -0
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/tests/test_preview_pca.py → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/decomposition/tests/test_pca.py +25 -9
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/dispatcher.py +241 -60
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/ensemble/_forest.py +250 -188
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/ensemble/tests/test_forest.py +39 -21
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/glob/dispatcher.py +16 -2
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/__init__.py +32 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/linear_model/coordinate_descent.py +13 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_linear.py +482 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/incremental_ridge.py +425 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/linear.py +341 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex}/linear_model/logistic_regression.py +194 -133
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/linear_model/ridge.py +7 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_linear.py +207 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_incremental_ridge.py +153 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_linear.py +167 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_logreg.py +134 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/manifold/t_sne.py +4 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/metrics/pairwise.py +5 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/metrics/ranking.py +3 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/model_selection/split.py +5 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/__init__.py +1 -1
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/neighbors/_lof.py +236 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/common.py +53 -6
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_classification.py +51 -155
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_regression.py +46 -149
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/knn_unsupervised.py +55 -100
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/neighbors/tests/test_neighbors.py +16 -18
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview}/__init__.py +1 -3
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/covariance/covariance.py +138 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/preview/covariance/tests/test_covariance.py +18 -5
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/__init__.py +19 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/incremental_pca.py +233 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/tests/test_incremental_pca.py +266 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/linear_model}/__init__.py +19 -19
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/linear_model/ridge.py +424 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/preview/linear_model/tests/test_ridge.py +102 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/__init__.py +1 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/incremental_basic_statistics.py +30 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +107 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics/tests/test_incremental_basic_statistics_spmd.py +307 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_dbscan_spmd.py +97 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/cluster/tests/test_kmeans_spmd.py +172 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/__init__.py +20 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/covariance.py +21 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/incremental_covariance.py +37 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_covariance_spmd.py +107 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/covariance/tests/test_incremental_covariance_spmd.py +184 -0
- {scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/spmd/basic_statistics → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition}/__init__.py +3 -2
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/tests/test_n_jobs_support.py → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/incremental_pca.py +11 -12
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_incremental_pca_spmd.py +269 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/decomposition/tests/test_pca_spmd.py +128 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/ensemble/forest.py +4 -12
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/ensemble/tests/test_forest_spmd.py +265 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/linear_model/__init__.py +3 -1
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/tests/test_config.py → scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/incremental_linear_model.py +14 -18
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/logistic_regression.py +21 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_incremental_linear_spmd.py +329 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +145 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py +162 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +288 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/svm/_common.py +339 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/nusvc.py +172 -78
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/nusvr.py +74 -70
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/svc.py +170 -77
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/svr.py +66 -66
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/tests/test_svm.py +12 -20
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_common.py +390 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_config.py +123 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_memory_usage.py +379 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_monkeypatch.py +276 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_n_jobs_support.py +108 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/tests/test_parallel.py +6 -8
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_patching.py +385 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/test_run_to_run_stability.py +321 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/utils/__init__.py +44 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/utils/base.py +371 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/tests/utils/spmd.py +198 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/utils/_array_api.py +82 -0
- scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/utils/tests/test_finite.py +89 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2025.1.0.dist-info}/METADATA +231 -230
- scikit_learn_intelex-2025.1.0.dist-info/RECORD +257 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2025.1.0.dist-info}/WHEEL +1 -1
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/_device_offload.py +0 -223
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/cluster/k_means.py +0 -17
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/cluster/tests/test_kmeans.py +0 -30
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/decomposition/pca.py +0 -17
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/decomposition/tests/test_pca.py +0 -27
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/linear_model/linear.py +0 -388
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/linear_model/logistic_path.py +0 -17
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_linear.py +0 -82
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/linear_model/tests/test_logreg.py +0 -28
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/neighbors/lof.py +0 -436
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/cluster/_common.py +0 -84
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/cluster/k_means.py +0 -376
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/covariance/covariance.py +0 -98
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/decomposition/pca.py +0 -376
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/preview/linear_model/tests/test_preview_logistic_regression.py +0 -59
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/svm/_common.py +0 -188
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/tests/test_memory_usage.py +0 -225
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/tests/test_monkeypatch.py +0 -227
- scikit_learn_intelex-2024.1.0.data/data/Lib/site-packages/sklearnex/tests/test_run_to_run_stability_tests.py +0 -428
- scikit_learn_intelex-2024.1.0.dist-info/RECORD +0 -97
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/__main__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/decomposition/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/doc/third-party-programs.txt +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/ensemble/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/glob/__main__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/manifold/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/manifold/tests/test_tsne.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/metrics/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/metrics/tests/test_metrics.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/model_selection/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/model_selection/tests/test_model_selection.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/preview/covariance/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/basic_statistics/basic_statistics.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/cluster/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/cluster/dbscan.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/cluster/kmeans.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/decomposition/pca.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/ensemble/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/linear_model/linear_model.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/neighbors/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/spmd/neighbors/neighbors.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/svm/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/utils/__init__.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/utils/parallel.py +0 -0
- {scikit_learn_intelex-2024.1.0.data → scikit_learn_intelex-2025.1.0.data}/data/Lib/site-packages/sklearnex/utils/validation.py +0 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2025.1.0.dist-info}/LICENSE.txt +0 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2025.1.0.dist-info}/top_level.txt +0 -0
|
@@ -18,6 +18,7 @@ import logging
|
|
|
18
18
|
import os
|
|
19
19
|
import sys
|
|
20
20
|
import warnings
|
|
21
|
+
from abc import ABC
|
|
21
22
|
|
|
22
23
|
from daal4py.sklearn._utils import (
|
|
23
24
|
PatchingConditionsChain as daal4py_PatchingConditionsChain,
|
|
@@ -29,10 +30,10 @@ class PatchingConditionsChain(daal4py_PatchingConditionsChain):
|
|
|
29
30
|
def get_status(self):
|
|
30
31
|
return self.patching_is_enabled
|
|
31
32
|
|
|
32
|
-
def write_log(self, queue=None):
|
|
33
|
+
def write_log(self, queue=None, transferred_to_host=True):
|
|
33
34
|
if self.patching_is_enabled:
|
|
34
35
|
self.logger.info(
|
|
35
|
-
f"{self.scope_name}: {get_patch_message('onedal', queue=queue)}"
|
|
36
|
+
f"{self.scope_name}: {get_patch_message('onedal', queue=queue, transferred_to_host=transferred_to_host)}"
|
|
36
37
|
)
|
|
37
38
|
else:
|
|
38
39
|
self.logger.debug(
|
|
@@ -43,7 +44,9 @@ class PatchingConditionsChain(daal4py_PatchingConditionsChain):
|
|
|
43
44
|
self.logger.debug(
|
|
44
45
|
f"{self.scope_name}: patching failed with cause - {message}"
|
|
45
46
|
)
|
|
46
|
-
self.logger.info(
|
|
47
|
+
self.logger.info(
|
|
48
|
+
f"{self.scope_name}: {get_patch_message('sklearn', transferred_to_host=transferred_to_host)}"
|
|
49
|
+
)
|
|
47
50
|
|
|
48
51
|
|
|
49
52
|
def set_sklearn_ex_verbose():
|
|
@@ -66,7 +69,7 @@ def set_sklearn_ex_verbose():
|
|
|
66
69
|
)
|
|
67
70
|
|
|
68
71
|
|
|
69
|
-
def get_patch_message(s, queue=None):
|
|
72
|
+
def get_patch_message(s, queue=None, transferred_to_host=True):
|
|
70
73
|
if s == "onedal":
|
|
71
74
|
message = "running accelerated version on "
|
|
72
75
|
if queue is not None:
|
|
@@ -87,6 +90,10 @@ def get_patch_message(s, queue=None):
|
|
|
87
90
|
f"Invalid input - expected one of 'onedal','sklearn',"
|
|
88
91
|
f" 'sklearn_after_onedal', got {s}"
|
|
89
92
|
)
|
|
93
|
+
if transferred_to_host:
|
|
94
|
+
message += (
|
|
95
|
+
". All input data transferred to host for further backend computations."
|
|
96
|
+
)
|
|
90
97
|
return message
|
|
91
98
|
|
|
92
99
|
|
|
@@ -107,3 +114,19 @@ def register_hyperparameters(hyperparameters_map):
|
|
|
107
114
|
return estimator_class
|
|
108
115
|
|
|
109
116
|
return wrap_class
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# This abstract class is meant to generate a clickable doc link for classses
|
|
120
|
+
# in sklearnex that are not part of base scikit-learn. It should be inherited
|
|
121
|
+
# before inheriting from a scikit-learn estimator, otherwise will get overriden
|
|
122
|
+
# by the estimator's original.
|
|
123
|
+
class IntelEstimator(ABC):
|
|
124
|
+
@property
|
|
125
|
+
def _doc_link_module(self) -> str:
|
|
126
|
+
return "sklearnex"
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def _doc_link_template(self) -> str:
|
|
130
|
+
module_path, _ = self.__class__.__module__.rsplit(".", 1)
|
|
131
|
+
class_name = self.__class__.__name__
|
|
132
|
+
return f"https://intel.github.io/scikit-learn-intelex/latest/non-scikit-algorithms.html#{module_path}.{class_name}"
|
scikit_learn_intelex-2025.1.0.data/data/Lib/site-packages/sklearnex/basic_statistics/__init__.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2023 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 .basic_statistics import BasicStatistics
|
|
18
|
+
from .incremental_basic_statistics import IncrementalBasicStatistics
|
|
19
|
+
|
|
20
|
+
__all__ = ["BasicStatistics", "IncrementalBasicStatistics"]
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Copyright 2023 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 warnings
|
|
18
|
+
|
|
19
|
+
import numpy as np
|
|
20
|
+
from sklearn.base import BaseEstimator
|
|
21
|
+
from sklearn.utils import check_array
|
|
22
|
+
from sklearn.utils.validation import _check_sample_weight
|
|
23
|
+
|
|
24
|
+
from daal4py.sklearn._n_jobs_support import control_n_jobs
|
|
25
|
+
from daal4py.sklearn._utils import sklearn_check_version
|
|
26
|
+
from onedal.basic_statistics import BasicStatistics as onedal_BasicStatistics
|
|
27
|
+
|
|
28
|
+
from .._device_offload import dispatch
|
|
29
|
+
from .._utils import IntelEstimator, PatchingConditionsChain
|
|
30
|
+
|
|
31
|
+
if sklearn_check_version("1.6"):
|
|
32
|
+
from sklearn.utils.validation import validate_data
|
|
33
|
+
else:
|
|
34
|
+
validate_data = BaseEstimator._validate_data
|
|
35
|
+
|
|
36
|
+
if sklearn_check_version("1.2"):
|
|
37
|
+
from sklearn.utils._param_validation import StrOptions
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@control_n_jobs(decorated_methods=["fit"])
|
|
41
|
+
class BasicStatistics(IntelEstimator, BaseEstimator):
|
|
42
|
+
"""
|
|
43
|
+
Estimator for basic statistics.
|
|
44
|
+
Allows to compute basic statistics for provided data.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
result_options: string or list, default='all'
|
|
49
|
+
Used to set statistics to calculate. Possible values are ``'min'``, ``'max'``, ``'sum'``, ``'mean'``, ``'variance'``,
|
|
50
|
+
``'variation'``, ``sum_squares'``, ``sum_squares_centered'``, ``'standard_deviation'``, ``'second_order_raw_moment'``
|
|
51
|
+
or a list containing any of these values. If set to ``'all'`` then all possible statistics will be
|
|
52
|
+
calculated.
|
|
53
|
+
|
|
54
|
+
Attributes
|
|
55
|
+
----------
|
|
56
|
+
min_ : ndarray of shape (n_features,)
|
|
57
|
+
Minimum of each feature over all samples.
|
|
58
|
+
max_ : ndarray of shape (n_features,)
|
|
59
|
+
Maximum of each feature over all samples.
|
|
60
|
+
sum_ : ndarray of shape (n_features,)
|
|
61
|
+
Sum of each feature over all samples.
|
|
62
|
+
mean_ : ndarray of shape (n_features,)
|
|
63
|
+
Mean of each feature over all samples.
|
|
64
|
+
variance_ : ndarray of shape (n_features,)
|
|
65
|
+
Variance of each feature over all samples.
|
|
66
|
+
variation_ : ndarray of shape (n_features,)
|
|
67
|
+
Variation of each feature over all samples.
|
|
68
|
+
sum_squares_ : ndarray of shape (n_features,)
|
|
69
|
+
Sum of squares for each feature over all samples.
|
|
70
|
+
standard_deviation_ : ndarray of shape (n_features,)
|
|
71
|
+
Standard deviation of each feature over all samples.
|
|
72
|
+
sum_squares_centered_ : ndarray of shape (n_features,)
|
|
73
|
+
Centered sum of squares for each feature over all samples.
|
|
74
|
+
second_order_raw_moment_ : ndarray of shape (n_features,)
|
|
75
|
+
Second order moment of each feature over all samples.
|
|
76
|
+
|
|
77
|
+
Note
|
|
78
|
+
----
|
|
79
|
+
Attribute exists only if corresponding result option has been provided.
|
|
80
|
+
|
|
81
|
+
Note
|
|
82
|
+
----
|
|
83
|
+
Names of attributes without the trailing underscore are
|
|
84
|
+
supported currently but deprecated in 2025.1 and will be removed in 2026.0
|
|
85
|
+
|
|
86
|
+
Note
|
|
87
|
+
----
|
|
88
|
+
Some results can exhibit small variations due to
|
|
89
|
+
floating point error accumulation and multithreading.
|
|
90
|
+
|
|
91
|
+
Examples
|
|
92
|
+
--------
|
|
93
|
+
>>> import numpy as np
|
|
94
|
+
>>> from sklearnex.basic_statistics import BasicStatistics
|
|
95
|
+
>>> bs = BasicStatistics(result_options=['sum', 'min', 'max'])
|
|
96
|
+
>>> X = np.array([[1, 2], [3, 4]])
|
|
97
|
+
>>> bs.fit(X)
|
|
98
|
+
>>> bs.sum_
|
|
99
|
+
np.array([4., 6.])
|
|
100
|
+
>>> bs.min_
|
|
101
|
+
np.array([1., 2.])
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
def __init__(self, result_options="all"):
|
|
105
|
+
self.result_options = result_options
|
|
106
|
+
|
|
107
|
+
_onedal_basic_statistics = staticmethod(onedal_BasicStatistics)
|
|
108
|
+
|
|
109
|
+
if sklearn_check_version("1.2"):
|
|
110
|
+
_parameter_constraints: dict = {
|
|
111
|
+
"result_options": [
|
|
112
|
+
StrOptions(
|
|
113
|
+
{
|
|
114
|
+
"all",
|
|
115
|
+
"min",
|
|
116
|
+
"max",
|
|
117
|
+
"sum",
|
|
118
|
+
"mean",
|
|
119
|
+
"variance",
|
|
120
|
+
"variation",
|
|
121
|
+
"sum_squares",
|
|
122
|
+
"standard_deviation",
|
|
123
|
+
"sum_squares_centered",
|
|
124
|
+
"second_order_raw_moment",
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
list,
|
|
128
|
+
],
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
def _save_attributes(self):
|
|
132
|
+
assert hasattr(self, "_onedal_estimator")
|
|
133
|
+
|
|
134
|
+
if self.result_options == "all":
|
|
135
|
+
result_options = onedal_BasicStatistics.get_all_result_options()
|
|
136
|
+
else:
|
|
137
|
+
result_options = self.result_options
|
|
138
|
+
|
|
139
|
+
if isinstance(result_options, str):
|
|
140
|
+
setattr(
|
|
141
|
+
self,
|
|
142
|
+
result_options + "_",
|
|
143
|
+
getattr(self._onedal_estimator, result_options),
|
|
144
|
+
)
|
|
145
|
+
elif isinstance(result_options, list):
|
|
146
|
+
for option in result_options:
|
|
147
|
+
setattr(self, option + "_", getattr(self._onedal_estimator, option))
|
|
148
|
+
|
|
149
|
+
def __getattr__(self, attr):
|
|
150
|
+
if self.result_options == "all":
|
|
151
|
+
result_options = onedal_BasicStatistics.get_all_result_options()
|
|
152
|
+
else:
|
|
153
|
+
result_options = self.result_options
|
|
154
|
+
is_deprecated_attr = (
|
|
155
|
+
isinstance(result_options, str) and (attr == result_options)
|
|
156
|
+
) or (isinstance(result_options, list) and (attr in result_options))
|
|
157
|
+
if is_deprecated_attr:
|
|
158
|
+
warnings.warn(
|
|
159
|
+
"Result attributes without a trailing underscore were deprecated in version 2025.1 and will be removed in 2026.0"
|
|
160
|
+
)
|
|
161
|
+
attr += "_"
|
|
162
|
+
if attr in self.__dict__:
|
|
163
|
+
return self.__dict__[attr]
|
|
164
|
+
|
|
165
|
+
raise AttributeError(
|
|
166
|
+
f"'{self.__class__.__name__}' object has no attribute '{attr}'"
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def _onedal_supported(self, method_name, *data):
|
|
170
|
+
patching_status = PatchingConditionsChain(
|
|
171
|
+
f"sklearnex.basic_statistics.{self.__class__.__name__}.{method_name}"
|
|
172
|
+
)
|
|
173
|
+
return patching_status
|
|
174
|
+
|
|
175
|
+
_onedal_cpu_supported = _onedal_supported
|
|
176
|
+
_onedal_gpu_supported = _onedal_supported
|
|
177
|
+
|
|
178
|
+
def _onedal_fit(self, X, sample_weight=None, queue=None):
|
|
179
|
+
if sklearn_check_version("1.2"):
|
|
180
|
+
self._validate_params()
|
|
181
|
+
|
|
182
|
+
if sklearn_check_version("1.0"):
|
|
183
|
+
X = validate_data(self, X, dtype=[np.float64, np.float32], ensure_2d=False)
|
|
184
|
+
else:
|
|
185
|
+
X = check_array(X, dtype=[np.float64, np.float32])
|
|
186
|
+
|
|
187
|
+
if sample_weight is not None:
|
|
188
|
+
sample_weight = _check_sample_weight(sample_weight, X)
|
|
189
|
+
|
|
190
|
+
onedal_params = {
|
|
191
|
+
"result_options": self.result_options,
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if not hasattr(self, "_onedal_estimator"):
|
|
195
|
+
self._onedal_estimator = self._onedal_basic_statistics(**onedal_params)
|
|
196
|
+
self._onedal_estimator.fit(X, sample_weight, queue)
|
|
197
|
+
self._save_attributes()
|
|
198
|
+
self.n_features_in_ = X.shape[1] if len(X.shape) > 1 else 1
|
|
199
|
+
|
|
200
|
+
def fit(self, X, y=None, *, sample_weight=None):
|
|
201
|
+
"""Calculate statistics of X.
|
|
202
|
+
|
|
203
|
+
Parameters
|
|
204
|
+
----------
|
|
205
|
+
X : array-like of shape (n_samples, n_features)
|
|
206
|
+
Data for compute, where ``n_samples`` is the number of samples and
|
|
207
|
+
``n_features`` is the number of features.
|
|
208
|
+
|
|
209
|
+
y : Ignored
|
|
210
|
+
Not used, present for API consistency by convention.
|
|
211
|
+
|
|
212
|
+
sample_weight : array-like of shape (n_samples,), default=None
|
|
213
|
+
Weights for compute weighted statistics, where ``n_samples`` is the number of samples.
|
|
214
|
+
|
|
215
|
+
Returns
|
|
216
|
+
-------
|
|
217
|
+
self : object
|
|
218
|
+
Returns the instance itself.
|
|
219
|
+
"""
|
|
220
|
+
dispatch(
|
|
221
|
+
self,
|
|
222
|
+
"fit",
|
|
223
|
+
{
|
|
224
|
+
"onedal": self.__class__._onedal_fit,
|
|
225
|
+
"sklearn": None,
|
|
226
|
+
},
|
|
227
|
+
X,
|
|
228
|
+
sample_weight,
|
|
229
|
+
)
|
|
230
|
+
return self
|
|
@@ -0,0 +1,345 @@
|
|
|
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
|
+
import numpy as np
|
|
18
|
+
from sklearn.base import BaseEstimator
|
|
19
|
+
from sklearn.utils import check_array, gen_batches
|
|
20
|
+
from sklearn.utils.validation import _check_sample_weight
|
|
21
|
+
|
|
22
|
+
from daal4py.sklearn._n_jobs_support import control_n_jobs
|
|
23
|
+
from daal4py.sklearn._utils import sklearn_check_version
|
|
24
|
+
from onedal.basic_statistics import (
|
|
25
|
+
IncrementalBasicStatistics as onedal_IncrementalBasicStatistics,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
from .._device_offload import dispatch
|
|
29
|
+
from .._utils import IntelEstimator, PatchingConditionsChain
|
|
30
|
+
|
|
31
|
+
if sklearn_check_version("1.2"):
|
|
32
|
+
from sklearn.utils._param_validation import Interval, StrOptions
|
|
33
|
+
|
|
34
|
+
import numbers
|
|
35
|
+
import warnings
|
|
36
|
+
|
|
37
|
+
if sklearn_check_version("1.6"):
|
|
38
|
+
from sklearn.utils.validation import validate_data
|
|
39
|
+
else:
|
|
40
|
+
validate_data = BaseEstimator._validate_data
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@control_n_jobs(decorated_methods=["partial_fit", "_onedal_finalize_fit"])
|
|
44
|
+
class IncrementalBasicStatistics(IntelEstimator, BaseEstimator):
|
|
45
|
+
"""
|
|
46
|
+
Calculates basic statistics on the given data, allows for computation when the data are split into
|
|
47
|
+
batches. The user can use ``partial_fit`` method to provide a single batch of data or use the ``fit`` method to provide
|
|
48
|
+
the entire dataset.
|
|
49
|
+
|
|
50
|
+
Parameters
|
|
51
|
+
----------
|
|
52
|
+
result_options: string or list, default='all'
|
|
53
|
+
List of statistics to compute
|
|
54
|
+
|
|
55
|
+
batch_size : int, default=None
|
|
56
|
+
The number of samples to use for each batch. Only used when calling
|
|
57
|
+
``fit``. If ``batch_size`` is ``None``, then ``batch_size``
|
|
58
|
+
is inferred from the data and set to ``5 * n_features``.
|
|
59
|
+
|
|
60
|
+
Attributes
|
|
61
|
+
----------
|
|
62
|
+
min_ : ndarray of shape (n_features,)
|
|
63
|
+
Minimum of each feature over all samples.
|
|
64
|
+
|
|
65
|
+
max_ : ndarray of shape (n_features,)
|
|
66
|
+
Maximum of each feature over all samples.
|
|
67
|
+
|
|
68
|
+
sum_ : ndarray of shape (n_features,)
|
|
69
|
+
Sum of each feature over all samples.
|
|
70
|
+
|
|
71
|
+
mean_ : ndarray of shape (n_features,)
|
|
72
|
+
Mean of each feature over all samples.
|
|
73
|
+
|
|
74
|
+
variance_ : ndarray of shape (n_features,)
|
|
75
|
+
Variance of each feature over all samples.
|
|
76
|
+
|
|
77
|
+
variation_ : ndarray of shape (n_features,)
|
|
78
|
+
Variation of each feature over all samples.
|
|
79
|
+
|
|
80
|
+
sum_squares_ : ndarray of shape (n_features,)
|
|
81
|
+
Sum of squares for each feature over all samples.
|
|
82
|
+
|
|
83
|
+
standard_deviation_ : ndarray of shape (n_features,)
|
|
84
|
+
Standard deviation of each feature over all samples.
|
|
85
|
+
|
|
86
|
+
sum_squares_centered_ : ndarray of shape (n_features,)
|
|
87
|
+
Centered sum of squares for each feature over all samples.
|
|
88
|
+
|
|
89
|
+
second_order_raw_moment_ : ndarray of shape (n_features,)
|
|
90
|
+
Second order moment of each feature over all samples.
|
|
91
|
+
|
|
92
|
+
n_samples_seen_ : int
|
|
93
|
+
The number of samples processed by the estimator. Will be reset on
|
|
94
|
+
new calls to ``fit``, but increments across ``partial_fit`` calls.
|
|
95
|
+
|
|
96
|
+
batch_size_ : int
|
|
97
|
+
Inferred batch size from ``batch_size``.
|
|
98
|
+
|
|
99
|
+
n_features_in_ : int
|
|
100
|
+
Number of features seen during ``fit`` or ``partial_fit``.
|
|
101
|
+
|
|
102
|
+
Note
|
|
103
|
+
----
|
|
104
|
+
Attribute exists only if corresponding result option has been provided.
|
|
105
|
+
|
|
106
|
+
Note
|
|
107
|
+
----
|
|
108
|
+
Names of attributes without the trailing underscore are
|
|
109
|
+
supported currently but deprecated in 2025.1 and will be removed in 2026.0
|
|
110
|
+
|
|
111
|
+
Examples
|
|
112
|
+
--------
|
|
113
|
+
>>> import numpy as np
|
|
114
|
+
>>> from sklearnex.basic_statistics import IncrementalBasicStatistics
|
|
115
|
+
>>> incbs = IncrementalBasicStatistics(batch_size=1)
|
|
116
|
+
>>> X = np.array([[1, 2], [3, 4]])
|
|
117
|
+
>>> incbs.partial_fit(X[:1])
|
|
118
|
+
>>> incbs.partial_fit(X[1:])
|
|
119
|
+
>>> incbs.sum_
|
|
120
|
+
np.array([4., 6.])
|
|
121
|
+
>>> incbs.min_
|
|
122
|
+
np.array([1., 2.])
|
|
123
|
+
>>> incbs.fit(X)
|
|
124
|
+
>>> incbs.sum_
|
|
125
|
+
np.array([4., 6.])
|
|
126
|
+
>>> incbs.max_
|
|
127
|
+
np.array([3., 4.])
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
_onedal_incremental_basic_statistics = staticmethod(onedal_IncrementalBasicStatistics)
|
|
131
|
+
|
|
132
|
+
if sklearn_check_version("1.2"):
|
|
133
|
+
_parameter_constraints: dict = {
|
|
134
|
+
"result_options": [
|
|
135
|
+
StrOptions(
|
|
136
|
+
{
|
|
137
|
+
"all",
|
|
138
|
+
"min",
|
|
139
|
+
"max",
|
|
140
|
+
"sum",
|
|
141
|
+
"mean",
|
|
142
|
+
"variance",
|
|
143
|
+
"variation",
|
|
144
|
+
"sum_squares",
|
|
145
|
+
"standard_deviation",
|
|
146
|
+
"sum_squares_centered",
|
|
147
|
+
"second_order_raw_moment",
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
list,
|
|
151
|
+
],
|
|
152
|
+
"batch_size": [Interval(numbers.Integral, 1, None, closed="left"), None],
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
def __init__(self, result_options="all", batch_size=None):
|
|
156
|
+
if result_options == "all":
|
|
157
|
+
self.result_options = (
|
|
158
|
+
self._onedal_incremental_basic_statistics.get_all_result_options()
|
|
159
|
+
)
|
|
160
|
+
else:
|
|
161
|
+
self.result_options = result_options
|
|
162
|
+
self._need_to_finalize = False
|
|
163
|
+
self.batch_size = batch_size
|
|
164
|
+
|
|
165
|
+
def _onedal_supported(self, method_name, *data):
|
|
166
|
+
patching_status = PatchingConditionsChain(
|
|
167
|
+
f"sklearn.basic_statistics.{self.__class__.__name__}.{method_name}"
|
|
168
|
+
)
|
|
169
|
+
return patching_status
|
|
170
|
+
|
|
171
|
+
_onedal_cpu_supported = _onedal_supported
|
|
172
|
+
_onedal_gpu_supported = _onedal_supported
|
|
173
|
+
|
|
174
|
+
def _get_onedal_result_options(self, options):
|
|
175
|
+
if isinstance(options, list):
|
|
176
|
+
onedal_options = "|".join(self.result_options)
|
|
177
|
+
else:
|
|
178
|
+
onedal_options = options
|
|
179
|
+
assert isinstance(onedal_options, str)
|
|
180
|
+
return options
|
|
181
|
+
|
|
182
|
+
def _onedal_finalize_fit(self, queue=None):
|
|
183
|
+
assert hasattr(self, "_onedal_estimator")
|
|
184
|
+
self._onedal_estimator.finalize_fit(queue=queue)
|
|
185
|
+
self._need_to_finalize = False
|
|
186
|
+
|
|
187
|
+
def _onedal_partial_fit(self, X, sample_weight=None, queue=None, check_input=True):
|
|
188
|
+
first_pass = not hasattr(self, "n_samples_seen_") or self.n_samples_seen_ == 0
|
|
189
|
+
|
|
190
|
+
if check_input:
|
|
191
|
+
if sklearn_check_version("1.0"):
|
|
192
|
+
X = validate_data(
|
|
193
|
+
self,
|
|
194
|
+
X,
|
|
195
|
+
dtype=[np.float64, np.float32],
|
|
196
|
+
reset=first_pass,
|
|
197
|
+
)
|
|
198
|
+
else:
|
|
199
|
+
X = check_array(
|
|
200
|
+
X,
|
|
201
|
+
dtype=[np.float64, np.float32],
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
if sample_weight is not None:
|
|
205
|
+
sample_weight = _check_sample_weight(sample_weight, X)
|
|
206
|
+
|
|
207
|
+
if first_pass:
|
|
208
|
+
self.n_samples_seen_ = X.shape[0]
|
|
209
|
+
self.n_features_in_ = X.shape[1]
|
|
210
|
+
else:
|
|
211
|
+
self.n_samples_seen_ += X.shape[0]
|
|
212
|
+
|
|
213
|
+
onedal_params = {
|
|
214
|
+
"result_options": self._get_onedal_result_options(self.result_options)
|
|
215
|
+
}
|
|
216
|
+
if not hasattr(self, "_onedal_estimator"):
|
|
217
|
+
self._onedal_estimator = self._onedal_incremental_basic_statistics(
|
|
218
|
+
**onedal_params
|
|
219
|
+
)
|
|
220
|
+
self._onedal_estimator.partial_fit(X, weights=sample_weight, queue=queue)
|
|
221
|
+
self._need_to_finalize = True
|
|
222
|
+
|
|
223
|
+
def _onedal_fit(self, X, sample_weight=None, queue=None):
|
|
224
|
+
if sklearn_check_version("1.2"):
|
|
225
|
+
self._validate_params()
|
|
226
|
+
|
|
227
|
+
if sklearn_check_version("1.0"):
|
|
228
|
+
X = validate_data(self, X, dtype=[np.float64, np.float32])
|
|
229
|
+
else:
|
|
230
|
+
X = check_array(X, dtype=[np.float64, np.float32])
|
|
231
|
+
|
|
232
|
+
if sample_weight is not None:
|
|
233
|
+
sample_weight = _check_sample_weight(sample_weight, X)
|
|
234
|
+
|
|
235
|
+
n_samples, n_features = X.shape
|
|
236
|
+
if self.batch_size is None:
|
|
237
|
+
self.batch_size_ = 5 * n_features
|
|
238
|
+
else:
|
|
239
|
+
self.batch_size_ = self.batch_size
|
|
240
|
+
|
|
241
|
+
self.n_samples_seen_ = 0
|
|
242
|
+
if hasattr(self, "_onedal_estimator"):
|
|
243
|
+
self._onedal_estimator._reset()
|
|
244
|
+
|
|
245
|
+
for batch in gen_batches(X.shape[0], self.batch_size_):
|
|
246
|
+
X_batch = X[batch]
|
|
247
|
+
weights_batch = sample_weight[batch] if sample_weight is not None else None
|
|
248
|
+
self._onedal_partial_fit(
|
|
249
|
+
X_batch, weights_batch, queue=queue, check_input=False
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
self.n_features_in_ = X.shape[1]
|
|
253
|
+
|
|
254
|
+
self._onedal_finalize_fit(queue=queue)
|
|
255
|
+
|
|
256
|
+
return self
|
|
257
|
+
|
|
258
|
+
def __getattr__(self, attr):
|
|
259
|
+
result_options = self.__dict__["result_options"]
|
|
260
|
+
sattr = attr.removesuffix("_")
|
|
261
|
+
is_statistic_attr = (
|
|
262
|
+
isinstance(result_options, str) and (sattr == result_options)
|
|
263
|
+
) or (isinstance(result_options, list) and (sattr in result_options))
|
|
264
|
+
if is_statistic_attr:
|
|
265
|
+
if self._need_to_finalize:
|
|
266
|
+
self._onedal_finalize_fit()
|
|
267
|
+
if sattr == attr:
|
|
268
|
+
warnings.warn(
|
|
269
|
+
"Result attributes without a trailing underscore were deprecated in version 2025.1 and will be removed in 2026.0"
|
|
270
|
+
)
|
|
271
|
+
return getattr(self._onedal_estimator, sattr)
|
|
272
|
+
if attr in self.__dict__:
|
|
273
|
+
return self.__dict__[attr]
|
|
274
|
+
|
|
275
|
+
raise AttributeError(
|
|
276
|
+
f"'{self.__class__.__name__}' object has no attribute '{attr}'"
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
def partial_fit(self, X, sample_weight=None, check_input=True):
|
|
280
|
+
"""Incremental fit with X. All of X is processed as a single batch.
|
|
281
|
+
|
|
282
|
+
Parameters
|
|
283
|
+
----------
|
|
284
|
+
X : array-like of shape (n_samples, n_features)
|
|
285
|
+
Data for compute, where ``n_samples`` is the number of samples and
|
|
286
|
+
``n_features`` is the number of features.
|
|
287
|
+
|
|
288
|
+
y : Ignored
|
|
289
|
+
Not used, present for API consistency by convention.
|
|
290
|
+
|
|
291
|
+
sample_weight : array-like of shape (n_samples,), default=None
|
|
292
|
+
Weights for compute weighted statistics, where ``n_samples`` is the number of samples.
|
|
293
|
+
|
|
294
|
+
check_input : bool, default=True
|
|
295
|
+
Run ``check_array`` on X.
|
|
296
|
+
|
|
297
|
+
Returns
|
|
298
|
+
-------
|
|
299
|
+
self : object
|
|
300
|
+
Returns the instance itself.
|
|
301
|
+
"""
|
|
302
|
+
dispatch(
|
|
303
|
+
self,
|
|
304
|
+
"partial_fit",
|
|
305
|
+
{
|
|
306
|
+
"onedal": self.__class__._onedal_partial_fit,
|
|
307
|
+
"sklearn": None,
|
|
308
|
+
},
|
|
309
|
+
X,
|
|
310
|
+
sample_weight,
|
|
311
|
+
check_input=check_input,
|
|
312
|
+
)
|
|
313
|
+
return self
|
|
314
|
+
|
|
315
|
+
def fit(self, X, y=None, sample_weight=None):
|
|
316
|
+
"""Calculate statistics of X using minibatches of size batch_size.
|
|
317
|
+
|
|
318
|
+
Parameters
|
|
319
|
+
----------
|
|
320
|
+
X : array-like of shape (n_samples, n_features)
|
|
321
|
+
Data for compute, where ``n_samples`` is the number of samples and
|
|
322
|
+
``n_features`` is the number of features.
|
|
323
|
+
|
|
324
|
+
y : Ignored
|
|
325
|
+
Not used, present for API consistency by convention.
|
|
326
|
+
|
|
327
|
+
sample_weight : array-like of shape (n_samples,), default=None
|
|
328
|
+
Weights for compute weighted statistics, where ``n_samples`` is the number of samples.
|
|
329
|
+
|
|
330
|
+
Returns
|
|
331
|
+
-------
|
|
332
|
+
self : object
|
|
333
|
+
Returns the instance itself.
|
|
334
|
+
"""
|
|
335
|
+
dispatch(
|
|
336
|
+
self,
|
|
337
|
+
"fit",
|
|
338
|
+
{
|
|
339
|
+
"onedal": self.__class__._onedal_fit,
|
|
340
|
+
"sklearn": None,
|
|
341
|
+
},
|
|
342
|
+
X,
|
|
343
|
+
sample_weight,
|
|
344
|
+
)
|
|
345
|
+
return self
|