scikit-learn-intelex 2024.1.0__py39-none-manylinux1_x86_64.whl → 2024.3.0__py39-none-manylinux1_x86_64.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.

Files changed (51) hide show
  1. {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/METADATA +2 -2
  2. {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/RECORD +45 -44
  3. sklearnex/__init__.py +9 -7
  4. sklearnex/cluster/dbscan.py +6 -4
  5. sklearnex/conftest.py +63 -0
  6. sklearnex/{preview/decomposition → covariance}/__init__.py +19 -19
  7. sklearnex/covariance/incremental_covariance.py +130 -0
  8. sklearnex/covariance/tests/test_incremental_covariance.py +143 -0
  9. sklearnex/decomposition/pca.py +322 -1
  10. sklearnex/decomposition/tests/test_pca.py +34 -5
  11. sklearnex/dispatcher.py +91 -59
  12. sklearnex/ensemble/_forest.py +15 -24
  13. sklearnex/ensemble/tests/test_forest.py +15 -19
  14. sklearnex/linear_model/__init__.py +1 -2
  15. sklearnex/linear_model/linear.py +3 -10
  16. sklearnex/{preview/linear_model → linear_model}/logistic_regression.py +32 -40
  17. sklearnex/linear_model/tests/test_logreg.py +70 -7
  18. sklearnex/neighbors/__init__.py +1 -1
  19. sklearnex/neighbors/_lof.py +204 -0
  20. sklearnex/neighbors/knn_classification.py +13 -18
  21. sklearnex/neighbors/knn_regression.py +12 -17
  22. sklearnex/neighbors/knn_unsupervised.py +10 -15
  23. sklearnex/neighbors/tests/test_neighbors.py +12 -16
  24. sklearnex/preview/__init__.py +1 -1
  25. sklearnex/preview/cluster/k_means.py +3 -8
  26. sklearnex/preview/covariance/covariance.py +46 -12
  27. sklearnex/spmd/__init__.py +1 -0
  28. sklearnex/{preview/linear_model → spmd/covariance}/__init__.py +5 -5
  29. sklearnex/spmd/covariance/covariance.py +21 -0
  30. sklearnex/spmd/ensemble/forest.py +4 -12
  31. sklearnex/spmd/linear_model/__init__.py +2 -1
  32. sklearnex/spmd/linear_model/logistic_regression.py +21 -0
  33. sklearnex/svm/nusvc.py +9 -6
  34. sklearnex/svm/nusvr.py +6 -7
  35. sklearnex/svm/svc.py +9 -6
  36. sklearnex/svm/svr.py +3 -4
  37. sklearnex/tests/_utils.py +155 -0
  38. sklearnex/tests/test_memory_usage.py +9 -7
  39. sklearnex/tests/test_monkeypatch.py +179 -138
  40. sklearnex/tests/test_n_jobs_support.py +71 -9
  41. sklearnex/tests/test_parallel.py +6 -8
  42. sklearnex/tests/test_patching.py +321 -82
  43. sklearnex/neighbors/lof.py +0 -436
  44. sklearnex/preview/decomposition/pca.py +0 -376
  45. sklearnex/preview/decomposition/tests/test_preview_pca.py +0 -42
  46. sklearnex/preview/linear_model/tests/test_preview_logistic_regression.py +0 -59
  47. sklearnex/tests/_models_info.py +0 -170
  48. sklearnex/tests/utils/_launch_algorithms.py +0 -118
  49. {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/LICENSE.txt +0 -0
  50. {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/WHEEL +0 -0
  51. {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scikit-learn-intelex
3
- Version: 2024.1.0
3
+ Version: 2024.3.0
4
4
  Summary: Intel(R) Extension for Scikit-learn is a seamless way to speed up your Scikit-learn application.
5
5
  Home-page: https://github.com/intel/scikit-learn-intelex
6
6
  Author: Intel Corporation
@@ -31,7 +31,7 @@ Classifier: Topic :: Software Development
31
31
  Requires-Python: >=3.7
32
32
  Description-Content-Type: text/markdown
33
33
  License-File: LICENSE.txt
34
- Requires-Dist: daal4py (==2024.1.0)
34
+ Requires-Dist: daal4py (==2024.3.0)
35
35
  Requires-Dist: scikit-learn (>=0.22)
36
36
 
37
37
 
@@ -1,32 +1,37 @@
1
- sklearnex/__init__.py,sha256=ScbLh27pOsTushgVj4zxZsNOLLYct65-7XrD_96Pu94,1648
1
+ sklearnex/__init__.py,sha256=DVpGCMMQcUlrOGj_iy1jk3ZhCfa0_TFISYLqaUDRqC0,1780
2
2
  sklearnex/__main__.py,sha256=Le9BJq6aLEGSSoZwJLsOADxsV89ynBfA8BcoJHk9F24,1921
3
3
  sklearnex/_config.py,sha256=6WS3UuS4-0DxIJyGn7yQMosj-mGkLybLQrg3W7dED5o,3928
4
4
  sklearnex/_device_offload.py,sha256=J0tZqj6tfvIFonWR01PadtTLgloQk_QEfXeCoqEvJlk,7710
5
5
  sklearnex/_utils.py,sha256=EV4jC3plVdndsgrfPBsJZTzggrRdYWLwOpoIRWtTXt4,3812
6
- sklearnex/dispatcher.py,sha256=9prbr6QrUWjc8wq1OyTxhuFEIKlTR-Qup9ZMfNszBPE,12884
6
+ sklearnex/conftest.py,sha256=ZvcfQljZNBa3zlE1iITvuacHblugVtK6X80LwNXrnWI,2130
7
+ sklearnex/dispatcher.py,sha256=9NPax55jPByCK0zzIvvE4wtmEJ7pCMrDh7IPeP2-vZ8,14389
7
8
  sklearnex/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
8
9
  sklearnex/basic_statistics/basic_statistics.py,sha256=j5jBZ3DgXjoyjCBEFfYQHyl3LgLXEWWFnNHwInThdZw,796
9
10
  sklearnex/cluster/__init__.py,sha256=TsDzdbKzEubaP86iY8a7mSW0ZQzgjzGYuPkhc5lZmlQ,853
10
- sklearnex/cluster/dbscan.py,sha256=o3ZJVsvQXGG5y2bUja7Xd0V57VQGmB93FWDbKVo20kw,6674
11
+ sklearnex/cluster/dbscan.py,sha256=JJaNVhV4dVK0xte9xzQpCAka80xVu3M7_SzmvD3k-EY,6736
11
12
  sklearnex/cluster/k_means.py,sha256=1QKcFUQcnycu8kSD8uYSaDIuedHbxZsV_gvUfcEwVAM,806
12
13
  sklearnex/cluster/tests/test_dbscan.py,sha256=AgFoKwXFVyLKLvEtJVs0qlbBs1Ci3PcRft7f-6_ENOU,1464
13
14
  sklearnex/cluster/tests/test_kmeans.py,sha256=H3a9NSHRRSASo0Eceo44Kjq6GwEoMqMzcubaNt1s1QQ,1213
15
+ sklearnex/covariance/__init__.py,sha256=_c86wiKDGBH50ofN-_tn7lO4M2YVEWO5AHhJIfimUDk,859
16
+ sklearnex/covariance/incremental_covariance.py,sha256=3s9gmLP48DPhlhnFcg2JB7RQ2sliSZdNroJkv8-1sIA,4526
17
+ sklearnex/covariance/tests/test_incremental_covariance.py,sha256=JIa4p-1_RYvU2ZVLx27iz0OKp0Nwrl9sYCsT0Dlyi2I,5402
14
18
  sklearnex/decomposition/__init__.py,sha256=RJBYDWyvnn5DA-j5r4IqVdXLp6H4mdPySsSjnXhlv-U,805
15
- sklearnex/decomposition/pca.py,sha256=68ksLxTP5fMOUhRmiIq9QNm0YzQanBNzxsq-zA8DKaY,809
16
- sklearnex/decomposition/tests/test_pca.py,sha256=aP4gxjML38CFpknwNVIkZLQCc8t2rqYGlWVo03vsMfE,1146
19
+ sklearnex/decomposition/pca.py,sha256=XLUUM-bGeXiFXc81uUxNEIYwQ6e5edmjQ94wqnLt_xg,12829
20
+ sklearnex/decomposition/tests/test_pca.py,sha256=FJYMosxpQpdOo71QD0jVx47oWEhvVNdut_5EOxTyT_0,2201
17
21
  sklearnex/doc/third-party-programs.txt,sha256=qA1XbOqYkMRnp29p8VxXjfcH0kHE8NSO5s2heea83-8,21773
18
22
  sklearnex/ensemble/__init__.py,sha256=2xB2KfG7l7uJv0p3kfVhrs4KLM174SCsigZhYqwSYAA,1035
19
- sklearnex/ensemble/_forest.py,sha256=Q3foDFaNmEHVeYjK8dIvP_-6GvSEV7dYPTXCrVN0e6A,70441
20
- sklearnex/ensemble/tests/test_forest.py,sha256=KoETKE1sSpKgp38s9bepAujJjcG21eFX5RyYINcHCUo,4516
23
+ sklearnex/ensemble/_forest.py,sha256=kOtLig8WVipa2VbgMgTQAkHkbSd5UHcz05uMJCtJ8AE,70553
24
+ sklearnex/ensemble/tests/test_forest.py,sha256=r1GSPQuVVuWYoNB3ZLiGKfMSwq3lp5i6k-Rgr7InonQ,4456
21
25
  sklearnex/glob/__main__.py,sha256=--FAjkhh5E6a1TFOGu6_BM3MHe78jP8oSpl0xKiRtTI,2531
22
26
  sklearnex/glob/dispatcher.py,sha256=IEEPhAOCVzC2JDFvYtijbiPAbaUY5RrCAhFLRjMMe1w,3018
23
- sklearnex/linear_model/__init__.py,sha256=97jj68r_V3JmsO8sZJt9BXlXazAPAzAz0E56dsNu4Sk,1100
27
+ sklearnex/linear_model/__init__.py,sha256=5XZDZh8R0SmT8D8ZtSjW7-MKRO7l1jOZ8CUnt_OzHe4,1047
24
28
  sklearnex/linear_model/coordinate_descent.py,sha256=uZOHIKfFlHoMlNXZCh2MAnZE30fRZlmtcF7UsZQ3Vq4,822
25
- sklearnex/linear_model/linear.py,sha256=see-YysI8U1ilseHlerfcb97BFmenaubW-3BmDy0ixI,13870
29
+ sklearnex/linear_model/linear.py,sha256=ed7pNKKnRkwa-wC0haUCOGHQoPkA4AuFhKNMzmRL6Fw,13832
26
30
  sklearnex/linear_model/logistic_path.py,sha256=Nq3JPXSzE4bjamnP3gGQtsMKks2v7s6bSiuYRnFqrRw,849
31
+ sklearnex/linear_model/logistic_regression.py,sha256=KgQ97a7-4ywoRakCUlqPxp-0s4EMZr2XTah-NupKUUY,12990
27
32
  sklearnex/linear_model/ridge.py,sha256=0oxlM5McYYvl0KxK9OIGJKM6lOADuFSPTdfx-efJNTI,810
28
33
  sklearnex/linear_model/tests/test_linear.py,sha256=li9LLWgap6YCwvNiHQ9yHduvUIsK1lpXfuVNR3dLwig,3200
29
- sklearnex/linear_model/tests/test_logreg.py,sha256=KO4240ACvhLsVHC_H09lhj4APUWPxmimHBE1JoY6TB8,1175
34
+ sklearnex/linear_model/tests/test_logreg.py,sha256=mUYDwTDUekERlzxjnVeOeCUcNv4KJAXdTIiELZNSaDc,3283
30
35
  sklearnex/manifold/__init__.py,sha256=3FU5fY1YvHAyNeSlUHsZfPnAbvlAUtZpum0Obmok2KE,809
31
36
  sklearnex/manifold/t_sne.py,sha256=U6F_dGB6taVuEJvTnVBWD-sri3x3m0Khu3HI4wXidhg,805
32
37
  sklearnex/manifold/tests/test_tsne.py,sha256=SNqe1yg45mL4qIsxpX5hDpBsIyrv9r__6wfrerjp3yU,1063
@@ -37,61 +42,57 @@ sklearnex/metrics/tests/test_metrics.py,sha256=Nwfz8UV4V4fKLLY7f9P9eg8uY09xLXaFx
37
42
  sklearnex/model_selection/__init__.py,sha256=64045Y-nzLDBepO6IRjt88LhL2DM3KdvpCF2vvj_RpA,842
38
43
  sklearnex/model_selection/split.py,sha256=qjmy8sRf_QEG8LhT0ivn_tICMCYmt7ffZZV1-rLQnko,824
39
44
  sklearnex/model_selection/tests/test_model_selection.py,sha256=3kZIq8kba8SW93DBWXupoRymNStR1_mGGYSErQRnwME,1338
40
- sklearnex/neighbors/__init__.py,sha256=fyxRt3wosR6Tg_QYWOOt477jLisT2iZl6CzfTL1y9ro,1077
45
+ sklearnex/neighbors/__init__.py,sha256=_GMJ2L-6YechRYI2fOFwHjy0kebUncE81z4FmdXUlb8,1078
46
+ sklearnex/neighbors/_lof.py,sha256=5ze0t8_0EXMwsayKux70zJ0Cl4ndDjzv3Fkr2iUXMUc,8109
41
47
  sklearnex/neighbors/common.py,sha256=iia-EUIRUIohDCIGpHbVx2PeDlwUvz4Mj1Tn169jidA,10781
42
- sklearnex/neighbors/knn_classification.py,sha256=z6-GgVnOnkyypZGyf0wFOev2Hc8iWy62gfr4dMFFdXM,11023
43
- sklearnex/neighbors/knn_regression.py,sha256=Ns_VPJ1ismXcPeJkUp8JxiHe-Y3QqI0d5HZuub7owkQ,9917
44
- sklearnex/neighbors/knn_unsupervised.py,sha256=MaapzNDA1wy2ZTuCeqpkKDEMBItrbMoW0p3JniCRCsA,7590
45
- sklearnex/neighbors/lof.py,sha256=XNnqrOnpIC5apeg6nToxeGqjQNIEp7sotflmm9iF4UY,16264
46
- sklearnex/neighbors/tests/test_neighbors.py,sha256=EAGF7Opgf-xWUAWYc6OdDgW5-2XsdkzLK_a35IX4Se4,3565
47
- sklearnex/preview/__init__.py,sha256=hZfIgTkkkUVaQ-SKaqI-S_SiXCkUzCUYxpSnbrhhEJU,813
48
+ sklearnex/neighbors/knn_classification.py,sha256=eS_uUEdhlBITAUfsaUsAQRh85g01ltsDAug2Rog4gEQ,11161
49
+ sklearnex/neighbors/knn_regression.py,sha256=76eLRvngIy56RyNa4e6-Hz_OqeXiulm6CEkwO7ICuUA,9977
50
+ sklearnex/neighbors/knn_unsupervised.py,sha256=j9YsD5RzawcKWytr7UR3qNlNni5wkAh3vVZWRBSA7sQ,7542
51
+ sklearnex/neighbors/tests/test_neighbors.py,sha256=gcJeJwDoT7wvyvk423k9TDGTGfbXUSTQETUT-VYQ74U,3409
52
+ sklearnex/preview/__init__.py,sha256=OXC_k2kudA13rVesXb5ZlEC7_mKUS7uUra_BR-Tin30,780
48
53
  sklearnex/preview/cluster/__init__.py,sha256=FONzOuTGAb5NwdfFhLco99P_VccRk9NBkDHU3EKuAIs,794
49
54
  sklearnex/preview/cluster/_common.py,sha256=bgpzijxgyrAtdNCCHyCNsZ-N70KQYNwMuoCTNdUna6o,2718
50
- sklearnex/preview/cluster/k_means.py,sha256=hG_hq8dfHM8B97L9T6fPU5TuQB7d3URWHfnB1cskT_8,13022
55
+ sklearnex/preview/cluster/k_means.py,sha256=jSuU8E6r4fdbbBnxBpWp4ybBa62kCnbBx7zDXyUr0Cs,13007
51
56
  sklearnex/preview/covariance/__init__.py,sha256=DPYTk8lwcVphtwU8J3CyUYH8Uz6Zr0Uz4S6nn-RY5iM,825
52
- sklearnex/preview/covariance/covariance.py,sha256=FXcRqdrHAhRNsyD6hG4a63ZxHMOZqdOS9yAqzfPY1LI,3614
57
+ sklearnex/preview/covariance/covariance.py,sha256=LrNrGP62FEhTSBVaO-EOYAaq-Rszc1VS2B2IqMgh4oo,4938
53
58
  sklearnex/preview/covariance/tests/test_covariance.py,sha256=GYI4bMIhGnjmOXpt8J7R0JQmpm9eOvDjIphugRa4kD8,2140
54
- sklearnex/preview/decomposition/__init__.py,sha256=uRenwBGf7hHQqwAVYbBw3clUQB_HWUqJGOAKTuCnrcM,805
55
- sklearnex/preview/decomposition/pca.py,sha256=KkbK3NwBCvE_0eQryI3zFiwlXPiNdj4dCQd2ywgSIn8,14341
56
- sklearnex/preview/decomposition/tests/test_preview_pca.py,sha256=xcllHM-jDIq33rAWTeh_gjhS2qfCNbUIAI5KeLPA8aY,1790
57
- sklearnex/preview/linear_model/__init__.py,sha256=Xr9Gk6mCq794GDLA2UlJPiLovOhZAx6rA5Bu123L-Rg,832
58
- sklearnex/preview/linear_model/logistic_regression.py,sha256=KIqpboN15BFV4BOyEokc5LF9eiqwBetlx2i27WBNIK0,13377
59
- sklearnex/preview/linear_model/tests/test_preview_logistic_regression.py,sha256=UjHXFhlea2P7feUKC64uHGNOhJpEaM2EZoAK0JJbz3I,2422
60
- sklearnex/spmd/__init__.py,sha256=8cxQy-oCFy1TJto0qoRf4lt98siPx2c-YV99YC-sk6s,871
59
+ sklearnex/spmd/__init__.py,sha256=ChQy2kEWlo4KGvs0RnbPoPEVhdgl8URV099B1rZtF5Y,889
61
60
  sklearnex/spmd/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
62
61
  sklearnex/spmd/basic_statistics/basic_statistics.py,sha256=_dQ9mhVYxeuChATEpAmHpXDpgW3YvtK1qrG-kLr2MtI,886
63
62
  sklearnex/spmd/cluster/__init__.py,sha256=qBBfrCHh6_82EROLbu54XKk7SmmRwS1XJyCj0zwkoUw,1029
64
63
  sklearnex/spmd/cluster/dbscan.py,sha256=23YNzPhx4MZijU0md-E3ZkHpTkhUh5cmtS3loHe-KhI,1824
65
64
  sklearnex/spmd/cluster/kmeans.py,sha256=Rnb9tr9LXVto5vCAumk7ZJfa9BYYDhdD1qUWL-QK5bY,868
65
+ sklearnex/spmd/covariance/__init__.py,sha256=5xeL1REMIxCv5M1ya99GGKaVjctUngboZ3uXgxcZ04o,823
66
+ sklearnex/spmd/covariance/covariance.py,sha256=_oIlr1W1vqDHqIPnsCb04HcBCen5oBHQr5-_n9OSvIA,884
66
67
  sklearnex/spmd/decomposition/__init__.py,sha256=dBh0ZMIiaqdf3DKbt8FWNB2K9Iacs395m8OxaDFQg_M,784
67
68
  sklearnex/spmd/decomposition/pca.py,sha256=CUrsVD2jae-A9H8RB_emza_fe82CwnFa5PEy0fW_EZ8,871
68
69
  sklearnex/spmd/ensemble/__init__.py,sha256=B3yi7hWoVogMIiw0QRT_x5atsAFS-OO72YPLGeUQJ8M,873
69
- sklearnex/spmd/ensemble/forest.py,sha256=ao6lyzcxoRW-RG9xIYwtDFyM7JIjlF8wmQKpOv_oSRQ,3113
70
- sklearnex/spmd/linear_model/__init__.py,sha256=eCJGleo00O6c280G97i18KNmSvi6uwX7wM1ZN5JMqhw,819
70
+ sklearnex/spmd/ensemble/forest.py,sha256=vIJJd10wIigFMtJMsiNDNLJ_PP2om-60zpQY_fd11-U,2909
71
+ sklearnex/spmd/linear_model/__init__.py,sha256=WwqCr2DOyUnkSIHlP0yq0UI2yFDgSl5MHV7wu3QGJtA,893
71
72
  sklearnex/spmd/linear_model/linear_model.py,sha256=7QPCIQTWKBiZBTDZZbpZXi-REgxQCfRMt6rHPJAnc5E,883
73
+ sklearnex/spmd/linear_model/logistic_regression.py,sha256=q_HkfWcg0RgFbk2t9FeV0ZY28HHAOtkGEnUj4tLuwt4,885
72
74
  sklearnex/spmd/neighbors/__init__.py,sha256=S16sH8N_18LN_8AgC_wGK5EDSNyuN-F-gI6GVlaiWVE,906
73
75
  sklearnex/spmd/neighbors/neighbors.py,sha256=SiKAS_RVt34MUcGytBS5pHnI_5vFNxJn8jqt1MOhDh8,940
74
76
  sklearnex/svm/__init__.py,sha256=f3e4ZFwZfx6MsXsn94VK1xVm6mWKT5XCiHczo6zNyAQ,1057
75
77
  sklearnex/svm/_common.py,sha256=Dt1Iyz1g04zOW6hn9cHa9ruzM_MHAIq0ZEEIxh5s7nI,7167
76
- sklearnex/svm/nusvc.py,sha256=0-18XPzyhxQpD1nqVaUS-cymdnqZDCqZbCznD-oLr_U,8983
77
- sklearnex/svm/nusvr.py,sha256=BJiQYQV5-YS5P0DZTh3k-vvbGuu-GWZI3QBUsuxLMak,5215
78
- sklearnex/svm/svc.py,sha256=FL5GLMh82nhqUfaWjbAivghXq5iM9V_AVtkp_MAhCnI,10263
79
- sklearnex/svm/svr.py,sha256=dsVkOGsJ5qqx7uaWkkc5Dv7zwYaZrC1mUgcPQOadq7s,5219
78
+ sklearnex/svm/nusvc.py,sha256=-KMGIanTxVwT9ovvdvGuGBGoMMFQQpAyn1uCoz4CmXA,9150
79
+ sklearnex/svm/nusvr.py,sha256=bkLU8HRlpnnZGxdL6t44Uo-idw1KQOeq2shKBIXf24g,5237
80
+ sklearnex/svm/svc.py,sha256=2wa6gNGMLE1b-sPapP_i89P9fiALDamo8nRIo8H6VS4,10426
81
+ sklearnex/svm/svr.py,sha256=fmYi0dghOmmyFFVI59COX9-tyouQnSDfHIbs8GY8AHs,5241
80
82
  sklearnex/svm/tests/test_svm.py,sha256=Ru-aGNGCsRJts7SEEYbnKcVqUx-DqPyUtw-hEoMVpW8,4190
81
- sklearnex/tests/_models_info.py,sha256=xhjvnU3TvQg8J5Cih2hphWAOSsT8DnKmCyYbtwa0Qvs,4785
83
+ sklearnex/tests/_utils.py,sha256=XYWbUlcdzFDc2DKgHCBdScFrzarsWQrs9GKsTlJsqPs,5059
82
84
  sklearnex/tests/test_config.py,sha256=SnSJjxAAysISDyC3bYKSJiRHStkB9X-yjLeF11LpRog,1372
83
- sklearnex/tests/test_memory_usage.py,sha256=-9S5EY9Ivy6WRW18IJEY1uyJxo9073GwXHybnFrJULc,7381
84
- sklearnex/tests/test_monkeypatch.py,sha256=D1ATlQtrNAtpHE7zmIxl7Mv41HxmRDRFAnjBmkUDGW8,8233
85
- sklearnex/tests/test_n_jobs_support.py,sha256=fa_XVNbBm5YQIguz5mgiQM8jmf2pQ7IwE8mgutyAbxk,1242
86
- sklearnex/tests/test_parallel.py,sha256=bMu22noUvGiDX4oyxKIHPiOEoBP9lRQQUq6wq8ZD730,1776
87
- sklearnex/tests/test_patching.py,sha256=6H0Um6N5qhD5OZ875HhAcKPFXM81les5XWCCsaNyMb8,3759
85
+ sklearnex/tests/test_memory_usage.py,sha256=LwIuUgG7CUZ2kOk1XlxyaK7O3OlyoVwx40TgljaYs5Q,7327
86
+ sklearnex/tests/test_monkeypatch.py,sha256=_9s_4jFvbttOf8uCuBrS4rn_AzQdFlKyRlthnGacUcU,9669
87
+ sklearnex/tests/test_n_jobs_support.py,sha256=ynfCSdCMnR3yEq1YEf_cilVD7zSe0sS-ZQ9jC0hHo8M,3903
88
+ sklearnex/tests/test_parallel.py,sha256=0zzlh2VJZWcHw5W4QSUthtAygOb6K0Bg1ekNsrdGJQE,1770
89
+ sklearnex/tests/test_patching.py,sha256=eZQRz4GsUkm9yMZj_LgT62hMbUNVdTJg88_UccezoJA,13187
88
90
  sklearnex/tests/test_run_to_run_stability_tests.py,sha256=4HDOeJruA1EDILbyQJtsHFmEXC0D1upSHuOT-KyTlEc,14008
89
- sklearnex/tests/utils/_launch_algorithms.py,sha256=pJT5tAW9rWvk7GT37R-B0-e8SLz8e9FSZw8yu4LWNJ4,3724
90
91
  sklearnex/utils/__init__.py,sha256=I8mbJQ3Zsm_F3sCLAhJQb7tUrG30kVsQ-wZoqA8vDdA,842
91
92
  sklearnex/utils/parallel.py,sha256=VBcS-KUdyq7XpJUN6ygmNjyWtYLroghbvCxQ8nVU3YI,2085
92
93
  sklearnex/utils/validation.py,sha256=fjfhQiKnBQnD7LCBlacMyvsrhGnlMLRXk5Q69uoZIP4,827
93
- scikit_learn_intelex-2024.1.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
94
- scikit_learn_intelex-2024.1.0.dist-info/METADATA,sha256=qYwrcOCj5B6HvCitweNkQDzI5qgtww7X6MdAeKdLElo,12449
95
- scikit_learn_intelex-2024.1.0.dist-info/WHEEL,sha256=rxMEw7jRW2YnjujGudhK0a-ZC6J_VMIRJJ7uhbmewD4,107
96
- scikit_learn_intelex-2024.1.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
97
- scikit_learn_intelex-2024.1.0.dist-info/RECORD,,
94
+ scikit_learn_intelex-2024.3.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
95
+ scikit_learn_intelex-2024.3.0.dist-info/METADATA,sha256=KeIxHsT7qgO6Z0kvFuwF1SIZ5_fPWgQmgM40Iq7V1BE,12449
96
+ scikit_learn_intelex-2024.3.0.dist-info/WHEEL,sha256=rxMEw7jRW2YnjujGudhK0a-ZC6J_VMIRJJ7uhbmewD4,107
97
+ scikit_learn_intelex-2024.3.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
98
+ scikit_learn_intelex-2024.3.0.dist-info/RECORD,,
sklearnex/__init__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  # ==============================================================================
2
2
  # Copyright 2021 Intel Corporation
3
+ # Copyright 2024 Fujitsu Limited
3
4
  #
4
5
  # Licensed under the Apache License, Version 2.0 (the "License");
5
6
  # you may not use this file except in compliance with the License.
@@ -14,7 +15,7 @@
14
15
  # limitations under the License.
15
16
  # ==============================================================================
16
17
 
17
- from onedal.common.hyperparameters import get_hyperparameters
18
+ import os
18
19
 
19
20
  from . import utils
20
21
  from ._config import config_context, get_config, set_config
@@ -41,21 +42,22 @@ __all__ = [
41
42
  "linear_model",
42
43
  "manifold",
43
44
  "metrics",
45
+ "model_selection",
44
46
  "neighbors",
45
47
  "patch_sklearn",
46
48
  "set_config",
47
49
  "sklearn_is_patched",
48
- "sklearn_is_patchedget_patch_map",
49
50
  "svm",
50
51
  "unpatch_sklearn",
51
52
  "utils",
52
53
  ]
54
+ onedal_iface_flag = os.environ.get("OFF_ONEDAL_IFACE", "0")
55
+ if onedal_iface_flag == "0":
56
+ from onedal import _is_spmd_backend
57
+ from onedal.common.hyperparameters import get_hyperparameters
53
58
 
54
-
55
- from onedal import _is_dpc_backend
56
-
57
- if _is_dpc_backend:
58
- __all__.append("spmd")
59
+ if _is_spmd_backend:
60
+ __all__.append("spmd")
59
61
 
60
62
 
61
63
  from ._utils import set_sklearn_ex_verbose
@@ -22,10 +22,11 @@ from scipy import sparse as sp
22
22
  from sklearn.cluster import DBSCAN as sklearn_DBSCAN
23
23
  from sklearn.utils.validation import _check_sample_weight
24
24
 
25
- from daal4py.sklearn._utils import control_n_jobs, run_with_n_jobs, sklearn_check_version
25
+ from daal4py.sklearn._n_jobs_support import control_n_jobs
26
+ from daal4py.sklearn._utils import sklearn_check_version
26
27
  from onedal.cluster import DBSCAN as onedal_DBSCAN
27
28
 
28
- from .._device_offload import dispatch, wrap_output_data
29
+ from .._device_offload import dispatch
29
30
  from .._utils import PatchingConditionsChain
30
31
 
31
32
  if sklearn_check_version("1.1") and not sklearn_check_version("1.2"):
@@ -45,7 +46,7 @@ class BaseDBSCAN(ABC):
45
46
  self.n_features_in_ = self._onedal_estimator.n_features_in_
46
47
 
47
48
 
48
- @control_n_jobs
49
+ @control_n_jobs(decorated_methods=["fit"])
49
50
  class DBSCAN(sklearn_DBSCAN, BaseDBSCAN):
50
51
  __doc__ = sklearn_DBSCAN.__doc__
51
52
 
@@ -83,7 +84,6 @@ class DBSCAN(sklearn_DBSCAN, BaseDBSCAN):
83
84
  self.p = p
84
85
  self.n_jobs = n_jobs
85
86
 
86
- @run_with_n_jobs
87
87
  def _onedal_fit(self, X, y, sample_weight=None, queue=None):
88
88
  onedal_params = {
89
89
  "eps": self.eps,
@@ -186,3 +186,5 @@ class DBSCAN(sklearn_DBSCAN, BaseDBSCAN):
186
186
  )
187
187
 
188
188
  return self
189
+
190
+ fit.__doc__ = sklearn_DBSCAN.fit.__doc__
sklearnex/conftest.py ADDED
@@ -0,0 +1,63 @@
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 io
18
+ import logging
19
+
20
+ import pytest
21
+
22
+ from sklearnex import patch_sklearn, unpatch_sklearn
23
+
24
+
25
+ def pytest_configure(config):
26
+ config.addinivalue_line(
27
+ "markers", "allow_sklearn_fallback: mark test to not check for sklearnex usage"
28
+ )
29
+
30
+
31
+ @pytest.hookimpl(hookwrapper=True)
32
+ def pytest_runtest_call(item):
33
+ # setup logger to check for sklearn fallback
34
+ if not item.get_closest_marker("allow_sklearn_fallback"):
35
+ log_stream = io.StringIO()
36
+ log_handler = logging.StreamHandler(log_stream)
37
+ sklearnex_logger = logging.getLogger("sklearnex")
38
+ level = sklearnex_logger.level
39
+ sklearnex_stderr_handler = sklearnex_logger.handlers
40
+ sklearnex_logger.handlers = []
41
+ sklearnex_logger.addHandler(log_handler)
42
+ sklearnex_logger.setLevel(logging.INFO)
43
+ log_handler.setLevel(logging.INFO)
44
+
45
+ yield
46
+
47
+ sklearnex_logger.handlers = sklearnex_stderr_handler
48
+ sklearnex_logger.setLevel(level)
49
+ sklearnex_logger.removeHandler(log_handler)
50
+ text = log_stream.getvalue()
51
+ if "fallback to original Scikit-learn" in text:
52
+ raise TypeError(
53
+ f"test did not properly evaluate sklearnex functionality and fell back to sklearn:\n{text}"
54
+ )
55
+ else:
56
+ yield
57
+
58
+
59
+ @pytest.fixture
60
+ def with_sklearnex():
61
+ patch_sklearn()
62
+ yield
63
+ unpatch_sklearn()
@@ -1,19 +1,19 @@
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 .pca import PCA
18
-
19
- __all__ = ["PCA"]
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
+ from .incremental_covariance import IncrementalEmpiricalCovariance
18
+
19
+ __all__ = ["IncrementalEmpiricalCovariance"]
@@ -0,0 +1,130 @@
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.utils import check_array, gen_batches
19
+
20
+ from daal4py.sklearn._n_jobs_support import control_n_jobs
21
+ from onedal._device_offload import support_usm_ndarray
22
+ from onedal.covariance import (
23
+ IncrementalEmpiricalCovariance as onedal_IncrementalEmpiricalCovariance,
24
+ )
25
+
26
+
27
+ @control_n_jobs(decorated_methods=["partial_fit"])
28
+ class IncrementalEmpiricalCovariance:
29
+ """
30
+ Incremental estimator for covariance.
31
+ Allows to compute empirical covariance estimated by maximum
32
+ likelihood method if data are splitted into batches.
33
+
34
+ Parameters
35
+ ----------
36
+ batch_size : int, default=None
37
+ The number of samples to use for each batch. Only used when calling
38
+ ``fit``. If ``batch_size`` is ``None``, then ``batch_size``
39
+ is inferred from the data and set to ``5 * n_features``, to provide a
40
+ balance between approximation accuracy and memory consumption.
41
+
42
+ Attributes
43
+ ----------
44
+ location_ : ndarray of shape (n_features,)
45
+ Estimated location, i.e. the estimated mean.
46
+
47
+ covariance_ : ndarray of shape (n_features, n_features)
48
+ Estimated covariance matrix
49
+ """
50
+
51
+ _onedal_incremental_covariance = staticmethod(onedal_IncrementalEmpiricalCovariance)
52
+
53
+ def __init__(self, batch_size=None):
54
+ self._need_to_finalize = False # If True then finalize compute should
55
+ # be called to obtain covariance_ or location_ from partial compute data
56
+ self.batch_size = batch_size
57
+
58
+ def _onedal_finalize_fit(self):
59
+ assert hasattr(self, "_onedal_estimator")
60
+ self._onedal_estimator.finalize_fit()
61
+ self._need_to_finalize = False
62
+
63
+ def _onedal_partial_fit(self, X, queue):
64
+ onedal_params = {
65
+ "method": "dense",
66
+ "bias": True,
67
+ }
68
+ if not hasattr(self, "_onedal_estimator"):
69
+ self._onedal_estimator = self._onedal_incremental_covariance(**onedal_params)
70
+ self._onedal_estimator.partial_fit(X, queue)
71
+ self._need_to_finalize = True
72
+
73
+ @property
74
+ def covariance_(self):
75
+ if self._need_to_finalize:
76
+ self._onedal_finalize_fit()
77
+ return self._onedal_estimator.covariance_
78
+
79
+ @property
80
+ def location_(self):
81
+ if self._need_to_finalize:
82
+ self._onedal_finalize_fit()
83
+ return self._onedal_estimator.location_
84
+
85
+ @support_usm_ndarray()
86
+ def partial_fit(self, X, queue=None):
87
+ """
88
+ Incremental fit with X. All of X is processed as a single batch.
89
+
90
+ Parameters
91
+ ----------
92
+ X : array-like of shape (n_samples, n_features)
93
+ Training data, where `n_samples` is the number of samples and
94
+ `n_features` is the number of features.
95
+
96
+ Returns
97
+ -------
98
+ self : object
99
+ Returns the instance itself.
100
+ """
101
+ X = check_array(X, dtype=[np.float64, np.float32])
102
+ self._onedal_partial_fit(X, queue)
103
+ return self
104
+
105
+ def fit(self, X, queue=None):
106
+ """
107
+ Fit the model with X, using minibatches of size batch_size.
108
+
109
+ Parameters
110
+ ----------
111
+ X : array-like of shape (n_samples, n_features)
112
+ Training data, where `n_samples` is the number of samples and
113
+ `n_features` is the number of features.
114
+
115
+ Returns
116
+ -------
117
+ self : object
118
+ Returns the instance itself.
119
+ """
120
+ n_samples, n_features = X.shape
121
+ if self.batch_size is None:
122
+ batch_size_ = 5 * n_features
123
+ else:
124
+ batch_size_ = self.batch_size
125
+ for batch in gen_batches(n_samples, batch_size_):
126
+ X_batch = X[batch]
127
+ self.partial_fit(X_batch, queue=queue)
128
+
129
+ self._onedal_finalize_fit()
130
+ return self
@@ -0,0 +1,143 @@
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
+ import pytest
19
+ from numpy.testing import assert_allclose
20
+
21
+ from onedal.tests.utils._dataframes_support import (
22
+ _convert_to_dataframe,
23
+ get_dataframes_and_queues,
24
+ )
25
+
26
+
27
+ @pytest.mark.parametrize("dataframe,queue", get_dataframes_and_queues())
28
+ @pytest.mark.parametrize("dtype", [np.float32, np.float64])
29
+ def test_sklearnex_partial_fit_on_gold_data(dataframe, queue, dtype):
30
+ from sklearnex.covariance import IncrementalEmpiricalCovariance
31
+
32
+ X = np.array([[0, 1], [0, 1]])
33
+ X = X.astype(dtype)
34
+ X_split = np.array_split(X, 2)
35
+ inccov = IncrementalEmpiricalCovariance()
36
+
37
+ for i in range(2):
38
+ X_split_df = _convert_to_dataframe(
39
+ X_split[i], sycl_queue=queue, target_df=dataframe
40
+ )
41
+ result = inccov.partial_fit(X_split_df)
42
+
43
+ expected_covariance = np.array([[0, 0], [0, 0]])
44
+ expected_means = np.array([0, 1])
45
+
46
+ assert_allclose(expected_covariance, result.covariance_)
47
+ assert_allclose(expected_means, result.location_)
48
+
49
+ X = np.array([[1, 2], [3, 6]])
50
+ X = X.astype(dtype)
51
+ X_split = np.array_split(X, 2)
52
+ inccov = IncrementalEmpiricalCovariance()
53
+
54
+ for i in range(2):
55
+ X_split_df = _convert_to_dataframe(
56
+ X_split[i], sycl_queue=queue, target_df=dataframe
57
+ )
58
+ result = inccov.partial_fit(X_split_df)
59
+
60
+ expected_covariance = np.array([[1, 2], [2, 4]])
61
+ expected_means = np.array([2, 4])
62
+
63
+ assert_allclose(expected_covariance, result.covariance_)
64
+ assert_allclose(expected_means, result.location_)
65
+
66
+
67
+ @pytest.mark.parametrize("dataframe,queue", get_dataframes_and_queues())
68
+ @pytest.mark.parametrize("batch_size", [2, 4])
69
+ @pytest.mark.parametrize("dtype", [np.float32, np.float64])
70
+ def test_sklearnex_fit_on_gold_data(dataframe, queue, batch_size, dtype):
71
+ from sklearnex.covariance import IncrementalEmpiricalCovariance
72
+
73
+ X = np.array([[0, 1, 2, 3], [0, -1, -2, -3], [0, 1, 2, 3], [0, 1, 2, 3]])
74
+ X = X.astype(dtype)
75
+ X_df = _convert_to_dataframe(X, sycl_queue=queue, target_df=dataframe)
76
+ inccov = IncrementalEmpiricalCovariance(batch_size=batch_size)
77
+
78
+ result = inccov.fit(X_df)
79
+
80
+ expected_covariance = np.array(
81
+ [[0, 0, 0, 0], [0, 0.75, 1.5, 2.25], [0, 1.5, 3, 4.5], [0, 2.25, 4.5, 6.75]]
82
+ )
83
+ expected_means = np.array([0, 0.5, 1, 1.5])
84
+
85
+ assert_allclose(expected_covariance, result.covariance_)
86
+ assert_allclose(expected_means, result.location_)
87
+
88
+
89
+ @pytest.mark.parametrize("dataframe,queue", get_dataframes_and_queues())
90
+ @pytest.mark.parametrize("num_batches", [2, 4, 6, 8, 10])
91
+ @pytest.mark.parametrize("row_count", [100, 1000, 2000])
92
+ @pytest.mark.parametrize("column_count", [10, 100, 200])
93
+ @pytest.mark.parametrize("dtype", [np.float32, np.float64])
94
+ def test_sklearnex_partial_fit_on_random_data(
95
+ dataframe, queue, num_batches, row_count, column_count, dtype
96
+ ):
97
+ from sklearnex.covariance import IncrementalEmpiricalCovariance
98
+
99
+ seed = 77
100
+ gen = np.random.default_rng(seed)
101
+ X = gen.uniform(low=-0.3, high=+0.7, size=(row_count, column_count))
102
+ X = X.astype(dtype)
103
+ X_split = np.array_split(X, num_batches)
104
+ inccov = IncrementalEmpiricalCovariance()
105
+
106
+ for i in range(num_batches):
107
+ X_split_df = _convert_to_dataframe(
108
+ X_split[i], sycl_queue=queue, target_df=dataframe
109
+ )
110
+ result = inccov.partial_fit(X_split_df)
111
+
112
+ expected_covariance = np.cov(X.T, bias=1)
113
+ expected_means = np.mean(X, axis=0)
114
+
115
+ assert_allclose(expected_covariance, result.covariance_, atol=1e-6)
116
+ assert_allclose(expected_means, result.location_, atol=1e-6)
117
+
118
+
119
+ @pytest.mark.parametrize("dataframe,queue", get_dataframes_and_queues())
120
+ @pytest.mark.parametrize("num_batches", [2, 4, 6, 8, 10])
121
+ @pytest.mark.parametrize("row_count", [100, 1000, 2000])
122
+ @pytest.mark.parametrize("column_count", [10, 100, 200])
123
+ @pytest.mark.parametrize("dtype", [np.float32, np.float64])
124
+ def test_sklearnex_fit_on_random_data(
125
+ dataframe, queue, num_batches, row_count, column_count, dtype
126
+ ):
127
+ from sklearnex.covariance import IncrementalEmpiricalCovariance
128
+
129
+ seed = 77
130
+ gen = np.random.default_rng(seed)
131
+ X = gen.uniform(low=-0.3, high=+0.7, size=(row_count, column_count))
132
+ X = X.astype(dtype)
133
+ X_df = _convert_to_dataframe(X, sycl_queue=queue, target_df=dataframe)
134
+ batch_size = row_count // num_batches
135
+ inccov = IncrementalEmpiricalCovariance(batch_size=batch_size)
136
+
137
+ result = inccov.fit(X_df)
138
+
139
+ expected_covariance = np.cov(X.T, bias=1)
140
+ expected_means = np.mean(X, axis=0)
141
+
142
+ assert_allclose(expected_covariance, result.covariance_, atol=1e-6)
143
+ assert_allclose(expected_means, result.location_, atol=1e-6)