scikit-learn-intelex 2024.3.0__py310-none-manylinux1_x86_64.whl → 2024.5.0__py310-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 (43) hide show
  1. {scikit_learn_intelex-2024.3.0.dist-info → scikit_learn_intelex-2024.5.0.dist-info}/METADATA +2 -2
  2. {scikit_learn_intelex-2024.3.0.dist-info → scikit_learn_intelex-2024.5.0.dist-info}/RECORD +43 -37
  3. sklearnex/_device_offload.py +39 -5
  4. sklearnex/basic_statistics/__init__.py +2 -1
  5. sklearnex/basic_statistics/incremental_basic_statistics.py +288 -0
  6. sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +384 -0
  7. sklearnex/covariance/incremental_covariance.py +217 -30
  8. sklearnex/covariance/tests/test_incremental_covariance.py +54 -17
  9. sklearnex/decomposition/pca.py +71 -19
  10. sklearnex/decomposition/tests/test_pca.py +2 -2
  11. sklearnex/dispatcher.py +33 -2
  12. sklearnex/ensemble/_forest.py +73 -79
  13. sklearnex/linear_model/__init__.py +5 -3
  14. sklearnex/linear_model/incremental_linear.py +387 -0
  15. sklearnex/linear_model/linear.py +275 -340
  16. sklearnex/linear_model/logistic_regression.py +50 -9
  17. sklearnex/linear_model/tests/test_incremental_linear.py +200 -0
  18. sklearnex/linear_model/tests/test_linear.py +40 -5
  19. sklearnex/neighbors/_lof.py +53 -36
  20. sklearnex/neighbors/common.py +4 -1
  21. sklearnex/neighbors/knn_classification.py +37 -122
  22. sklearnex/neighbors/knn_regression.py +10 -117
  23. sklearnex/neighbors/knn_unsupervised.py +6 -78
  24. sklearnex/neighbors/tests/test_neighbors.py +2 -2
  25. sklearnex/preview/cluster/k_means.py +5 -73
  26. sklearnex/preview/covariance/covariance.py +6 -5
  27. sklearnex/preview/covariance/tests/test_covariance.py +18 -5
  28. sklearnex/svm/_common.py +4 -7
  29. sklearnex/svm/nusvc.py +66 -50
  30. sklearnex/svm/nusvr.py +3 -49
  31. sklearnex/svm/svc.py +66 -51
  32. sklearnex/svm/svr.py +3 -49
  33. sklearnex/tests/_utils.py +34 -16
  34. sklearnex/tests/test_memory_usage.py +5 -1
  35. sklearnex/tests/test_n_jobs_support.py +12 -2
  36. sklearnex/tests/test_patching.py +87 -58
  37. sklearnex/tests/test_run_to_run_stability_tests.py +1 -1
  38. sklearnex/utils/__init__.py +2 -1
  39. sklearnex/utils/_namespace.py +97 -0
  40. sklearnex/utils/tests/test_finite.py +89 -0
  41. {scikit_learn_intelex-2024.3.0.dist-info → scikit_learn_intelex-2024.5.0.dist-info}/LICENSE.txt +0 -0
  42. {scikit_learn_intelex-2024.3.0.dist-info → scikit_learn_intelex-2024.5.0.dist-info}/WHEEL +0 -0
  43. {scikit_learn_intelex-2024.3.0.dist-info → scikit_learn_intelex-2024.5.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.3.0
3
+ Version: 2024.5.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.3.0)
34
+ Requires-Dist: daal4py (==2024.5.0)
35
35
  Requires-Dist: scikit-learn (>=0.22)
36
36
 
37
37
 
@@ -1,36 +1,40 @@
1
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
- sklearnex/_device_offload.py,sha256=J0tZqj6tfvIFonWR01PadtTLgloQk_QEfXeCoqEvJlk,7710
4
+ sklearnex/_device_offload.py,sha256=m8Hspffwx6Tn3f-OYLqwf5cUCKq4vZ3aSLmhY92qp08,8876
5
5
  sklearnex/_utils.py,sha256=EV4jC3plVdndsgrfPBsJZTzggrRdYWLwOpoIRWtTXt4,3812
6
6
  sklearnex/conftest.py,sha256=ZvcfQljZNBa3zlE1iITvuacHblugVtK6X80LwNXrnWI,2130
7
- sklearnex/dispatcher.py,sha256=9NPax55jPByCK0zzIvvE4wtmEJ7pCMrDh7IPeP2-vZ8,14389
8
- sklearnex/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
7
+ sklearnex/dispatcher.py,sha256=FtPF7nezu67wKhG33FAxJCWK8jCj65G87k7AITOIxtw,15390
8
+ sklearnex/basic_statistics/__init__.py,sha256=-lNh54F2FO0BuHDBLjhW7zp3yBcgFZ-DrXHj2H5hLXE,920
9
9
  sklearnex/basic_statistics/basic_statistics.py,sha256=j5jBZ3DgXjoyjCBEFfYQHyl3LgLXEWWFnNHwInThdZw,796
10
+ sklearnex/basic_statistics/incremental_basic_statistics.py,sha256=NNWF9zdxBz2jT7dzt5hL6HRvjQIGosvViQE3KJMF1L4,10048
11
+ sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py,sha256=zTb_04DBGYSfwcpRaP0OJzi4Z6jz4jqV_kDRAp1x-no,14926
10
12
  sklearnex/cluster/__init__.py,sha256=TsDzdbKzEubaP86iY8a7mSW0ZQzgjzGYuPkhc5lZmlQ,853
11
13
  sklearnex/cluster/dbscan.py,sha256=JJaNVhV4dVK0xte9xzQpCAka80xVu3M7_SzmvD3k-EY,6736
12
14
  sklearnex/cluster/k_means.py,sha256=1QKcFUQcnycu8kSD8uYSaDIuedHbxZsV_gvUfcEwVAM,806
13
15
  sklearnex/cluster/tests/test_dbscan.py,sha256=AgFoKwXFVyLKLvEtJVs0qlbBs1Ci3PcRft7f-6_ENOU,1464
14
16
  sklearnex/cluster/tests/test_kmeans.py,sha256=H3a9NSHRRSASo0Eceo44Kjq6GwEoMqMzcubaNt1s1QQ,1213
15
17
  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
18
+ sklearnex/covariance/incremental_covariance.py,sha256=0MvYlGnmuZ8_kRBaIkMzg3RyGdcSMjO-I7dhw2VpTsg,11010
19
+ sklearnex/covariance/tests/test_incremental_covariance.py,sha256=ZbEfup4ICm278RW4hZIHPciOiqhFhx_k1l3lpnw0M6s,6763
18
20
  sklearnex/decomposition/__init__.py,sha256=RJBYDWyvnn5DA-j5r4IqVdXLp6H4mdPySsSjnXhlv-U,805
19
- sklearnex/decomposition/pca.py,sha256=XLUUM-bGeXiFXc81uUxNEIYwQ6e5edmjQ94wqnLt_xg,12829
20
- sklearnex/decomposition/tests/test_pca.py,sha256=FJYMosxpQpdOo71QD0jVx47oWEhvVNdut_5EOxTyT_0,2201
21
+ sklearnex/decomposition/pca.py,sha256=JkyxsSz_8vVGUjJrfxyAwwY1Yf2uht-qxwOisEHv9mY,15550
22
+ sklearnex/decomposition/tests/test_pca.py,sha256=-3r3QwALcZregRq-MX8aUFSVaHu0D2ffGt-V5JOnNgE,2223
21
23
  sklearnex/doc/third-party-programs.txt,sha256=qA1XbOqYkMRnp29p8VxXjfcH0kHE8NSO5s2heea83-8,21773
22
24
  sklearnex/ensemble/__init__.py,sha256=2xB2KfG7l7uJv0p3kfVhrs4KLM174SCsigZhYqwSYAA,1035
23
- sklearnex/ensemble/_forest.py,sha256=kOtLig8WVipa2VbgMgTQAkHkbSd5UHcz05uMJCtJ8AE,70553
25
+ sklearnex/ensemble/_forest.py,sha256=6vyyQvg60Df-0v9ITIgwrSj2J1RQvGPa2-8Xs5_qXrQ,70003
24
26
  sklearnex/ensemble/tests/test_forest.py,sha256=r1GSPQuVVuWYoNB3ZLiGKfMSwq3lp5i6k-Rgr7InonQ,4456
25
27
  sklearnex/glob/__main__.py,sha256=--FAjkhh5E6a1TFOGu6_BM3MHe78jP8oSpl0xKiRtTI,2531
26
28
  sklearnex/glob/dispatcher.py,sha256=IEEPhAOCVzC2JDFvYtijbiPAbaUY5RrCAhFLRjMMe1w,3018
27
- sklearnex/linear_model/__init__.py,sha256=5XZDZh8R0SmT8D8ZtSjW7-MKRO7l1jOZ8CUnt_OzHe4,1047
29
+ sklearnex/linear_model/__init__.py,sha256=mzZ0EaBhDH66ETNt2vylznSoZbCYexgL2qE_jKppYYc,1144
28
30
  sklearnex/linear_model/coordinate_descent.py,sha256=uZOHIKfFlHoMlNXZCh2MAnZE30fRZlmtcF7UsZQ3Vq4,822
29
- sklearnex/linear_model/linear.py,sha256=ed7pNKKnRkwa-wC0haUCOGHQoPkA4AuFhKNMzmRL6Fw,13832
31
+ sklearnex/linear_model/incremental_linear.py,sha256=26XywxAyyTM6kUCJsuayRtCijKKmSfckiNjrkn5VzHc,13021
32
+ sklearnex/linear_model/linear.py,sha256=2VPcB7SNWlZKK1iHeAQagM2OxBPGFKK4FlY8TjBSZ3U,11162
30
33
  sklearnex/linear_model/logistic_path.py,sha256=Nq3JPXSzE4bjamnP3gGQtsMKks2v7s6bSiuYRnFqrRw,849
31
- sklearnex/linear_model/logistic_regression.py,sha256=KgQ97a7-4ywoRakCUlqPxp-0s4EMZr2XTah-NupKUUY,12990
34
+ sklearnex/linear_model/logistic_regression.py,sha256=6TRaDJ8nIHxjofIfUvmeJOP9_EwmUgVKKK1sxe9vS5A,14171
32
35
  sklearnex/linear_model/ridge.py,sha256=0oxlM5McYYvl0KxK9OIGJKM6lOADuFSPTdfx-efJNTI,810
33
- sklearnex/linear_model/tests/test_linear.py,sha256=li9LLWgap6YCwvNiHQ9yHduvUIsK1lpXfuVNR3dLwig,3200
36
+ sklearnex/linear_model/tests/test_incremental_linear.py,sha256=AfebVKne6fb36Vyr8uPSKYWa9upfPHYZUURHa4Q-mPs,7303
37
+ sklearnex/linear_model/tests/test_linear.py,sha256=nw5EqvF4sAy1dFBQobX0blvHUxZieDbt3wztQcuHrME,4315
34
38
  sklearnex/linear_model/tests/test_logreg.py,sha256=mUYDwTDUekERlzxjnVeOeCUcNv4KJAXdTIiELZNSaDc,3283
35
39
  sklearnex/manifold/__init__.py,sha256=3FU5fY1YvHAyNeSlUHsZfPnAbvlAUtZpum0Obmok2KE,809
36
40
  sklearnex/manifold/t_sne.py,sha256=U6F_dGB6taVuEJvTnVBWD-sri3x3m0Khu3HI4wXidhg,805
@@ -43,19 +47,19 @@ sklearnex/model_selection/__init__.py,sha256=64045Y-nzLDBepO6IRjt88LhL2DM3KdvpCF
43
47
  sklearnex/model_selection/split.py,sha256=qjmy8sRf_QEG8LhT0ivn_tICMCYmt7ffZZV1-rLQnko,824
44
48
  sklearnex/model_selection/tests/test_model_selection.py,sha256=3kZIq8kba8SW93DBWXupoRymNStR1_mGGYSErQRnwME,1338
45
49
  sklearnex/neighbors/__init__.py,sha256=_GMJ2L-6YechRYI2fOFwHjy0kebUncE81z4FmdXUlb8,1078
46
- sklearnex/neighbors/_lof.py,sha256=5ze0t8_0EXMwsayKux70zJ0Cl4ndDjzv3Fkr2iUXMUc,8109
47
- sklearnex/neighbors/common.py,sha256=iia-EUIRUIohDCIGpHbVx2PeDlwUvz4Mj1Tn169jidA,10781
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
50
+ sklearnex/neighbors/_lof.py,sha256=5MPkWIb6FS55Q8xWzgc22Ec_PsouuN94SPovt-vsBGE,8648
51
+ sklearnex/neighbors/common.py,sha256=8DxDoYtXtEM4RNoMCimpTVSDOOxUIJlNVOQvBXBhkd4,10875
52
+ sklearnex/neighbors/knn_classification.py,sha256=ONoBbtwb5xoVLcpg5COpRNu1ZBOQ2EDh03RzbWDy5yo,8537
53
+ sklearnex/neighbors/knn_regression.py,sha256=YBjvh6h56OaJHSZNGq8ZV8lsB-XpSWduEcVeHRuPorQ,6692
54
+ sklearnex/neighbors/knn_unsupervised.py,sha256=qkj-hSEq8QetYsWlofnik3PpFvo1iBUbIOhywo8wFWk,5362
55
+ sklearnex/neighbors/tests/test_neighbors.py,sha256=yAlMnLt9GrdT6Ceph5B7iFuMJXpDURiHWTE99oO8EDw,3417
52
56
  sklearnex/preview/__init__.py,sha256=OXC_k2kudA13rVesXb5ZlEC7_mKUS7uUra_BR-Tin30,780
53
57
  sklearnex/preview/cluster/__init__.py,sha256=FONzOuTGAb5NwdfFhLco99P_VccRk9NBkDHU3EKuAIs,794
54
58
  sklearnex/preview/cluster/_common.py,sha256=bgpzijxgyrAtdNCCHyCNsZ-N70KQYNwMuoCTNdUna6o,2718
55
- sklearnex/preview/cluster/k_means.py,sha256=jSuU8E6r4fdbbBnxBpWp4ybBa62kCnbBx7zDXyUr0Cs,13007
59
+ sklearnex/preview/cluster/k_means.py,sha256=RdF9mwgvZ1xgyeLhCQA2WaPvPsS1ndktXXcaNj6S460,10464
56
60
  sklearnex/preview/covariance/__init__.py,sha256=DPYTk8lwcVphtwU8J3CyUYH8Uz6Zr0Uz4S6nn-RY5iM,825
57
- sklearnex/preview/covariance/covariance.py,sha256=LrNrGP62FEhTSBVaO-EOYAaq-Rszc1VS2B2IqMgh4oo,4938
58
- sklearnex/preview/covariance/tests/test_covariance.py,sha256=GYI4bMIhGnjmOXpt8J7R0JQmpm9eOvDjIphugRa4kD8,2140
61
+ sklearnex/preview/covariance/covariance.py,sha256=NjRTWLie7UbpfN16wGSxJSRHRhUnvTn03cPPc8PpPd8,5131
62
+ sklearnex/preview/covariance/tests/test_covariance.py,sha256=FOgvhJxFQo9sNG4Uo-ebuw3ZXJ9tSxdk8qKm0ZJzTdc,2487
59
63
  sklearnex/spmd/__init__.py,sha256=ChQy2kEWlo4KGvs0RnbPoPEVhdgl8URV099B1rZtF5Y,889
60
64
  sklearnex/spmd/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
61
65
  sklearnex/spmd/basic_statistics/basic_statistics.py,sha256=_dQ9mhVYxeuChATEpAmHpXDpgW3YvtK1qrG-kLr2MtI,886
@@ -74,25 +78,27 @@ sklearnex/spmd/linear_model/logistic_regression.py,sha256=q_HkfWcg0RgFbk2t9FeV0Z
74
78
  sklearnex/spmd/neighbors/__init__.py,sha256=S16sH8N_18LN_8AgC_wGK5EDSNyuN-F-gI6GVlaiWVE,906
75
79
  sklearnex/spmd/neighbors/neighbors.py,sha256=SiKAS_RVt34MUcGytBS5pHnI_5vFNxJn8jqt1MOhDh8,940
76
80
  sklearnex/svm/__init__.py,sha256=f3e4ZFwZfx6MsXsn94VK1xVm6mWKT5XCiHczo6zNyAQ,1057
77
- sklearnex/svm/_common.py,sha256=Dt1Iyz1g04zOW6hn9cHa9ruzM_MHAIq0ZEEIxh5s7nI,7167
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
81
+ sklearnex/svm/_common.py,sha256=52csEWTYWEVgUVWUm3RjX1VD_5VyyawXBvc7lBBp5qY,7010
82
+ sklearnex/svm/nusvc.py,sha256=J4F_Tm9oYC-WK1Nf_CNqSnvuYEEZZ9xa3VY-x0G_2cw,9871
83
+ sklearnex/svm/nusvr.py,sha256=ZFBnQzMgD4aRSk3BRIxwKfwErVyDJnNoR7vrIMm5WLk,3655
84
+ sklearnex/svm/svc.py,sha256=u9wQ8dsvQvO4XP_3JSfYFBNJcuDyv3HVG5NY6jZqhZk,11125
85
+ sklearnex/svm/svr.py,sha256=ldNWehrU4vgqX_0T8splmBjPsQln7w_h8L4XNpIgP6A,3655
82
86
  sklearnex/svm/tests/test_svm.py,sha256=Ru-aGNGCsRJts7SEEYbnKcVqUx-DqPyUtw-hEoMVpW8,4190
83
- sklearnex/tests/_utils.py,sha256=XYWbUlcdzFDc2DKgHCBdScFrzarsWQrs9GKsTlJsqPs,5059
87
+ sklearnex/tests/_utils.py,sha256=bQR9PJ3GZzp3eZD35pLE8y-ts2a1VGq9ZbwFzh0e5q8,5598
84
88
  sklearnex/tests/test_config.py,sha256=SnSJjxAAysISDyC3bYKSJiRHStkB9X-yjLeF11LpRog,1372
85
- sklearnex/tests/test_memory_usage.py,sha256=LwIuUgG7CUZ2kOk1XlxyaK7O3OlyoVwx40TgljaYs5Q,7327
89
+ sklearnex/tests/test_memory_usage.py,sha256=nNVYn6S05q_J-eepNeGDfUKvzZCcHpCnm5jaZhCoPB8,7540
86
90
  sklearnex/tests/test_monkeypatch.py,sha256=_9s_4jFvbttOf8uCuBrS4rn_AzQdFlKyRlthnGacUcU,9669
87
- sklearnex/tests/test_n_jobs_support.py,sha256=ynfCSdCMnR3yEq1YEf_cilVD7zSe0sS-ZQ9jC0hHo8M,3903
91
+ sklearnex/tests/test_n_jobs_support.py,sha256=NziTP4GwZEDoBe1CDvhHZnp8JpwjYQmCNvXEDfS7Wo4,4313
88
92
  sklearnex/tests/test_parallel.py,sha256=0zzlh2VJZWcHw5W4QSUthtAygOb6K0Bg1ekNsrdGJQE,1770
89
- sklearnex/tests/test_patching.py,sha256=eZQRz4GsUkm9yMZj_LgT62hMbUNVdTJg88_UccezoJA,13187
90
- sklearnex/tests/test_run_to_run_stability_tests.py,sha256=4HDOeJruA1EDILbyQJtsHFmEXC0D1upSHuOT-KyTlEc,14008
91
- sklearnex/utils/__init__.py,sha256=I8mbJQ3Zsm_F3sCLAhJQb7tUrG30kVsQ-wZoqA8vDdA,842
93
+ sklearnex/tests/test_patching.py,sha256=mDTw-tzO8yibUeRp_ZE560fXnwfnsSq-JAHmXihx1hI,14920
94
+ sklearnex/tests/test_run_to_run_stability_tests.py,sha256=DFKMdIGyzGOBbi7A-o3zPZHLPAIDGIfLRxWzKIYa4hw,14019
95
+ sklearnex/utils/__init__.py,sha256=FFlM8zc2qnSdPYpLjSt4Ma_9FjC8qk8wXJa-5B8hCs0,898
96
+ sklearnex/utils/_namespace.py,sha256=lWzvzcObxq350A-Ms8JyTbaQStR8rgH4DgQYhWruHL4,3166
92
97
  sklearnex/utils/parallel.py,sha256=VBcS-KUdyq7XpJUN6ygmNjyWtYLroghbvCxQ8nVU3YI,2085
93
98
  sklearnex/utils/validation.py,sha256=fjfhQiKnBQnD7LCBlacMyvsrhGnlMLRXk5Q69uoZIP4,827
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=8HLRuLcXtw8zhRBAbl72hZgSmSYmdfyBfCzEjumF0eI,108
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,,
99
+ sklearnex/utils/tests/test_finite.py,sha256=AzJRY71X0VvDUicUI8Ey9Le6_yKp5O-3ZikhDVJNWms,2943
100
+ scikit_learn_intelex-2024.5.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
101
+ scikit_learn_intelex-2024.5.0.dist-info/METADATA,sha256=dvtXeQgf40S23qHORmZUGIJaFgl0KF5sqtvHueNvq3Y,12449
102
+ scikit_learn_intelex-2024.5.0.dist-info/WHEEL,sha256=8HLRuLcXtw8zhRBAbl72hZgSmSYmdfyBfCzEjumF0eI,108
103
+ scikit_learn_intelex-2024.5.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
104
+ scikit_learn_intelex-2024.5.0.dist-info/RECORD,,
@@ -16,6 +16,7 @@
16
16
 
17
17
  import logging
18
18
  import sys
19
+ from collections.abc import Iterable
19
20
  from functools import wraps
20
21
 
21
22
  import numpy as np
@@ -126,8 +127,15 @@ def _transfer_to_host(queue, *data):
126
127
  queue = usm_iface["syclobj"]
127
128
 
128
129
  buffer = as_usm_memory(item).copy_to_host()
130
+ order = "C"
131
+ if usm_iface["strides"] is not None:
132
+ if usm_iface["strides"][0] < usm_iface["strides"][1]:
133
+ order = "F"
129
134
  item = np.ndarray(
130
- shape=usm_iface["shape"], dtype=usm_iface["typestr"], buffer=buffer
135
+ shape=usm_iface["shape"],
136
+ dtype=usm_iface["typestr"],
137
+ buffer=buffer,
138
+ order=order,
131
139
  )
132
140
  has_usm_data = True
133
141
  else:
@@ -200,9 +208,35 @@ def _copy_to_usm(queue, array):
200
208
  raise RuntimeError(
201
209
  "dpctl need to be installed to work " "with __sycl_usm_array_interface__"
202
210
  )
203
- mem = MemoryUSMDevice(array.nbytes, queue=queue)
204
- mem.copy_from_host(array.tobytes())
205
- return usm_ndarray(array.shape, array.dtype, buffer=mem)
211
+
212
+ if hasattr(array, "__array__"):
213
+
214
+ try:
215
+ mem = MemoryUSMDevice(array.nbytes, queue=queue)
216
+ mem.copy_from_host(array.tobytes())
217
+ return usm_ndarray(array.shape, array.dtype, buffer=mem)
218
+ except ValueError as e:
219
+ # ValueError will raise if device does not support the dtype
220
+ # retry with float32 (needed for fp16 and fp64 support issues)
221
+ # try again as float32, if it is a float32 just raise the error.
222
+ if array.dtype == np.float32:
223
+ raise e
224
+ return _copy_to_usm(queue, array.astype(np.float32))
225
+ else:
226
+ if isinstance(array, Iterable):
227
+ array = [_copy_to_usm(queue, i) for i in array]
228
+ return array
229
+
230
+
231
+ if dpnp_available:
232
+
233
+ def _convert_to_dpnp(array):
234
+ if isinstance(array, usm_ndarray):
235
+ return dpnp.array(array, copy=False)
236
+ elif isinstance(array, Iterable):
237
+ for i in range(len(array)):
238
+ array[i] = _convert_to_dpnp(array[i])
239
+ return array
206
240
 
207
241
 
208
242
  def wrap_output_data(func):
@@ -217,7 +251,7 @@ def wrap_output_data(func):
217
251
  if usm_iface is not None:
218
252
  result = _copy_to_usm(usm_iface["syclobj"], result)
219
253
  if dpnp_available and isinstance(data[0], dpnp.ndarray):
220
- result = dpnp.array(result, copy=False)
254
+ result = _convert_to_dpnp(result)
221
255
  return result
222
256
 
223
257
  return wrapper
@@ -15,5 +15,6 @@
15
15
  # ==============================================================================
16
16
 
17
17
  from .basic_statistics import BasicStatistics
18
+ from .incremental_basic_statistics import IncrementalBasicStatistics
18
19
 
19
- __all__ = ["BasicStatistics"]
20
+ __all__ = ["BasicStatistics", "IncrementalBasicStatistics"]
@@ -0,0 +1,288 @@
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 PatchingConditionsChain
30
+
31
+ if sklearn_check_version("1.2"):
32
+ from sklearn.utils._param_validation import Interval, StrOptions
33
+
34
+ import numbers
35
+
36
+
37
+ @control_n_jobs(decorated_methods=["partial_fit", "_onedal_finalize_fit"])
38
+ class IncrementalBasicStatistics(BaseEstimator):
39
+ """
40
+ Incremental estimator for basic statistics.
41
+ Allows to compute basic statistics if data are splitted into batches.
42
+ Parameters
43
+ ----------
44
+ result_options: string or list, default='all'
45
+ List of statistics to compute
46
+
47
+ batch_size : int, default=None
48
+ The number of samples to use for each batch. Only used when calling
49
+ ``fit``. If ``batch_size`` is ``None``, then ``batch_size``
50
+ is inferred from the data and set to ``5 * n_features``, to provide a
51
+ balance between approximation accuracy and memory consumption.
52
+
53
+ Attributes (are existing only if corresponding result option exists)
54
+ ----------
55
+ min : ndarray of shape (n_features,)
56
+ Minimum of each feature over all samples.
57
+
58
+ max : ndarray of shape (n_features,)
59
+ Maximum of each feature over all samples.
60
+
61
+ sum : ndarray of shape (n_features,)
62
+ Sum of each feature over all samples.
63
+
64
+ mean : ndarray of shape (n_features,)
65
+ Mean of each feature over all samples.
66
+
67
+ variance : ndarray of shape (n_features,)
68
+ Variance of each feature over all samples.
69
+
70
+ variation : ndarray of shape (n_features,)
71
+ Variation of each feature over all samples.
72
+
73
+ sum_squares : ndarray of shape (n_features,)
74
+ Sum of squares for each feature over all samples.
75
+
76
+ standard_deviation : ndarray of shape (n_features,)
77
+ Standard deviation of each feature over all samples.
78
+
79
+ sum_squares_centered : ndarray of shape (n_features,)
80
+ Centered sum of squares for each feature over all samples.
81
+
82
+ second_order_raw_moment : ndarray of shape (n_features,)
83
+ Second order moment of each feature over all samples.
84
+ """
85
+
86
+ _onedal_incremental_basic_statistics = staticmethod(onedal_IncrementalBasicStatistics)
87
+
88
+ if sklearn_check_version("1.2"):
89
+ _parameter_constraints: dict = {
90
+ "result_options": [
91
+ StrOptions(
92
+ {
93
+ "all",
94
+ "min",
95
+ "max",
96
+ "sum",
97
+ "mean",
98
+ "variance",
99
+ "variation",
100
+ "sum_squares",
101
+ "standard_deviation",
102
+ "sum_squares_centered",
103
+ "second_order_raw_moment",
104
+ }
105
+ ),
106
+ list,
107
+ ],
108
+ "batch_size": [Interval(numbers.Integral, 1, None, closed="left"), None],
109
+ }
110
+
111
+ def __init__(self, result_options="all", batch_size=None):
112
+ if result_options == "all":
113
+ self.result_options = (
114
+ self._onedal_incremental_basic_statistics.get_all_result_options()
115
+ )
116
+ else:
117
+ self.result_options = result_options
118
+ self._need_to_finalize = False
119
+ self.batch_size = batch_size
120
+
121
+ def _onedal_supported(self, method_name, *data):
122
+ patching_status = PatchingConditionsChain(
123
+ f"sklearn.covariance.{self.__class__.__name__}.{method_name}"
124
+ )
125
+ return patching_status
126
+
127
+ _onedal_cpu_supported = _onedal_supported
128
+ _onedal_gpu_supported = _onedal_supported
129
+
130
+ def _get_onedal_result_options(self, options):
131
+ if isinstance(options, list):
132
+ onedal_options = "|".join(self.result_options)
133
+ else:
134
+ onedal_options = options
135
+ assert isinstance(onedal_options, str)
136
+ return options
137
+
138
+ def _onedal_finalize_fit(self):
139
+ assert hasattr(self, "_onedal_estimator")
140
+ self._onedal_estimator.finalize_fit()
141
+ self._need_to_finalize = False
142
+
143
+ def _onedal_partial_fit(self, X, sample_weight=None, queue=None):
144
+ first_pass = not hasattr(self, "n_samples_seen_") or self.n_samples_seen_ == 0
145
+
146
+ if sklearn_check_version("1.0"):
147
+ X = self._validate_data(
148
+ X,
149
+ dtype=[np.float64, np.float32],
150
+ reset=first_pass,
151
+ )
152
+ else:
153
+ X = check_array(
154
+ X,
155
+ dtype=[np.float64, np.float32],
156
+ )
157
+
158
+ if sample_weight is not None:
159
+ sample_weight = _check_sample_weight(sample_weight, X)
160
+
161
+ if first_pass:
162
+ self.n_samples_seen_ = X.shape[0]
163
+ self.n_features_in_ = X.shape[1]
164
+ else:
165
+ self.n_samples_seen_ += X.shape[0]
166
+
167
+ onedal_params = {
168
+ "result_options": self._get_onedal_result_options(self.result_options)
169
+ }
170
+ if not hasattr(self, "_onedal_estimator"):
171
+ self._onedal_estimator = self._onedal_incremental_basic_statistics(
172
+ **onedal_params
173
+ )
174
+ self._onedal_estimator.partial_fit(X, sample_weight, queue)
175
+ self._need_to_finalize = True
176
+
177
+ def _onedal_fit(self, X, sample_weight=None, queue=None):
178
+ if sklearn_check_version("1.0"):
179
+ X = self._validate_data(X, dtype=[np.float64, np.float32])
180
+ else:
181
+ X = check_array(X, dtype=[np.float64, np.float32])
182
+
183
+ if sample_weight is not None:
184
+ sample_weight = _check_sample_weight(sample_weight, X)
185
+
186
+ n_samples, n_features = X.shape
187
+ if self.batch_size is None:
188
+ self.batch_size_ = 5 * n_features
189
+ else:
190
+ self.batch_size_ = self.batch_size
191
+
192
+ self.n_samples_seen_ = 0
193
+ if hasattr(self, "_onedal_estimator"):
194
+ self._onedal_estimator._reset()
195
+
196
+ for batch in gen_batches(X.shape[0], self.batch_size_):
197
+ X_batch = X[batch]
198
+ weights_batch = sample_weight[batch] if sample_weight is not None else None
199
+ self._onedal_partial_fit(X_batch, weights_batch, queue=queue)
200
+
201
+ if sklearn_check_version("1.2"):
202
+ self._validate_params()
203
+
204
+ self.n_features_in_ = X.shape[1]
205
+
206
+ self._onedal_finalize_fit()
207
+
208
+ return self
209
+
210
+ def __getattr__(self, attr):
211
+ result_options = self.__dict__["result_options"]
212
+ is_statistic_attr = (
213
+ isinstance(result_options, str) and (attr == result_options)
214
+ ) or (isinstance(result_options, list) and (attr in result_options))
215
+ if is_statistic_attr:
216
+ if self._need_to_finalize:
217
+ self._onedal_finalize_fit()
218
+ return getattr(self._onedal_estimator, attr)
219
+ if attr in self.__dict__:
220
+ return self.__dict__[attr]
221
+
222
+ raise AttributeError(
223
+ f"'{self.__class__.__name__}' object has no attribute '{attr}'"
224
+ )
225
+
226
+ def partial_fit(self, X, sample_weight=None):
227
+ """Incremental fit with X. All of X is processed as a single batch.
228
+
229
+ Parameters
230
+ ----------
231
+ X : array-like of shape (n_samples, n_features)
232
+ Data for compute, where `n_samples` is the number of samples and
233
+ `n_features` is the number of features.
234
+
235
+ y : Ignored
236
+ Not used, present for API consistency by convention.
237
+
238
+ sample_weight : array-like of shape (n_samples,), default=None
239
+ Weights for compute weighted statistics, where `n_samples` is the number of samples.
240
+
241
+ Returns
242
+ -------
243
+ self : object
244
+ Returns the instance itself.
245
+ """
246
+ dispatch(
247
+ self,
248
+ "partial_fit",
249
+ {
250
+ "onedal": self.__class__._onedal_partial_fit,
251
+ "sklearn": None,
252
+ },
253
+ X,
254
+ sample_weight,
255
+ )
256
+ return self
257
+
258
+ def fit(self, X, y=None, sample_weight=None):
259
+ """Compute statistics with X, using minibatches of size batch_size.
260
+
261
+ Parameters
262
+ ----------
263
+ X : array-like of shape (n_samples, n_features)
264
+ Data for compute, where `n_samples` is the number of samples and
265
+ `n_features` is the number of features.
266
+
267
+ y : Ignored
268
+ Not used, present for API consistency by convention.
269
+
270
+ sample_weight : array-like of shape (n_samples,), default=None
271
+ Weights for compute weighted statistics, where `n_samples` is the number of samples.
272
+
273
+ Returns
274
+ -------
275
+ self : object
276
+ Returns the instance itself.
277
+ """
278
+ dispatch(
279
+ self,
280
+ "fit",
281
+ {
282
+ "onedal": self.__class__._onedal_fit,
283
+ "sklearn": None,
284
+ },
285
+ X,
286
+ sample_weight,
287
+ )
288
+ return self