scikit-learn-intelex 2024.2.0__py38-none-manylinux1_x86_64.whl → 2024.4.0__py38-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 (50) hide show
  1. {scikit_learn_intelex-2024.2.0.dist-info → scikit_learn_intelex-2024.4.0.dist-info}/METADATA +2 -2
  2. {scikit_learn_intelex-2024.2.0.dist-info → scikit_learn_intelex-2024.4.0.dist-info}/RECORD +45 -45
  3. sklearnex/__init__.py +9 -7
  4. sklearnex/_device_offload.py +31 -4
  5. sklearnex/basic_statistics/__init__.py +2 -1
  6. sklearnex/basic_statistics/incremental_basic_statistics.py +288 -0
  7. sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +386 -0
  8. sklearnex/cluster/dbscan.py +3 -1
  9. sklearnex/conftest.py +63 -0
  10. sklearnex/decomposition/pca.py +319 -1
  11. sklearnex/decomposition/tests/test_pca.py +34 -5
  12. sklearnex/dispatcher.py +74 -43
  13. sklearnex/ensemble/_forest.py +78 -89
  14. sklearnex/ensemble/tests/test_forest.py +15 -19
  15. sklearnex/linear_model/linear.py +275 -340
  16. sklearnex/linear_model/logistic_regression.py +63 -11
  17. sklearnex/linear_model/tests/test_linear.py +40 -5
  18. sklearnex/linear_model/tests/test_logreg.py +0 -2
  19. sklearnex/neighbors/_lof.py +74 -20
  20. sklearnex/neighbors/common.py +4 -1
  21. sklearnex/neighbors/knn_classification.py +44 -131
  22. sklearnex/neighbors/knn_regression.py +16 -126
  23. sklearnex/neighbors/knn_unsupervised.py +11 -86
  24. sklearnex/neighbors/tests/test_neighbors.py +0 -5
  25. sklearnex/preview/__init__.py +1 -1
  26. sklearnex/preview/cluster/k_means.py +5 -73
  27. sklearnex/preview/covariance/covariance.py +6 -5
  28. sklearnex/preview/covariance/tests/test_covariance.py +18 -5
  29. sklearnex/spmd/ensemble/forest.py +4 -12
  30. sklearnex/svm/_common.py +4 -7
  31. sklearnex/svm/nusvc.py +70 -50
  32. sklearnex/svm/nusvr.py +6 -52
  33. sklearnex/svm/svc.py +70 -51
  34. sklearnex/svm/svr.py +3 -49
  35. sklearnex/tests/_utils.py +164 -0
  36. sklearnex/tests/test_memory_usage.py +8 -3
  37. sklearnex/tests/test_monkeypatch.py +177 -149
  38. sklearnex/tests/test_n_jobs_support.py +8 -2
  39. sklearnex/tests/test_parallel.py +6 -8
  40. sklearnex/tests/test_patching.py +322 -87
  41. sklearnex/utils/__init__.py +2 -1
  42. sklearnex/utils/_namespace.py +97 -0
  43. sklearnex/preview/decomposition/__init__.py +0 -19
  44. sklearnex/preview/decomposition/pca.py +0 -374
  45. sklearnex/preview/decomposition/tests/test_preview_pca.py +0 -42
  46. sklearnex/tests/_models_info.py +0 -170
  47. sklearnex/tests/utils/_launch_algorithms.py +0 -118
  48. {scikit_learn_intelex-2024.2.0.dist-info → scikit_learn_intelex-2024.4.0.dist-info}/LICENSE.txt +0 -0
  49. {scikit_learn_intelex-2024.2.0.dist-info → scikit_learn_intelex-2024.4.0.dist-info}/WHEEL +0 -0
  50. {scikit_learn_intelex-2024.2.0.dist-info → scikit_learn_intelex-2024.4.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.2.0
3
+ Version: 2024.4.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.2.0)
34
+ Requires-Dist: daal4py (==2024.4.0)
35
35
  Requires-Dist: scikit-learn (>=0.22)
36
36
 
37
37
 
@@ -1,13 +1,16 @@
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
- sklearnex/_device_offload.py,sha256=J0tZqj6tfvIFonWR01PadtTLgloQk_QEfXeCoqEvJlk,7710
4
+ sklearnex/_device_offload.py,sha256=EX9bRBV9tFxQBRf8mS9ntBEmB7tcIfql8sYnb9Zjlto,8639
5
5
  sklearnex/_utils.py,sha256=EV4jC3plVdndsgrfPBsJZTzggrRdYWLwOpoIRWtTXt4,3812
6
- sklearnex/dispatcher.py,sha256=89QQ508iMt6qxoCIHt4woLvz_-KBOR6UvvhJJeC77hE,12878
7
- sklearnex/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
6
+ sklearnex/conftest.py,sha256=ZvcfQljZNBa3zlE1iITvuacHblugVtK6X80LwNXrnWI,2130
7
+ sklearnex/dispatcher.py,sha256=Vpoy6kwOR0Y3ISfjpk0S1vEKhDZGLUKeMy-xwCBsCQs,14389
8
+ sklearnex/basic_statistics/__init__.py,sha256=-lNh54F2FO0BuHDBLjhW7zp3yBcgFZ-DrXHj2H5hLXE,920
8
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=GarYPjojsyhbOat5vOXF85AofyFa_VretX4Vntc01C8,14992
9
12
  sklearnex/cluster/__init__.py,sha256=TsDzdbKzEubaP86iY8a7mSW0ZQzgjzGYuPkhc5lZmlQ,853
10
- sklearnex/cluster/dbscan.py,sha256=EegSXIFHKNhaKLoe_G8dsC5t2SXRdu3tDzsHbcubdDM,6706
13
+ sklearnex/cluster/dbscan.py,sha256=JJaNVhV4dVK0xte9xzQpCAka80xVu3M7_SzmvD3k-EY,6736
11
14
  sklearnex/cluster/k_means.py,sha256=1QKcFUQcnycu8kSD8uYSaDIuedHbxZsV_gvUfcEwVAM,806
12
15
  sklearnex/cluster/tests/test_dbscan.py,sha256=AgFoKwXFVyLKLvEtJVs0qlbBs1Ci3PcRft7f-6_ENOU,1464
13
16
  sklearnex/cluster/tests/test_kmeans.py,sha256=H3a9NSHRRSASo0Eceo44Kjq6GwEoMqMzcubaNt1s1QQ,1213
@@ -15,22 +18,22 @@ sklearnex/covariance/__init__.py,sha256=_c86wiKDGBH50ofN-_tn7lO4M2YVEWO5AHhJIfim
15
18
  sklearnex/covariance/incremental_covariance.py,sha256=3s9gmLP48DPhlhnFcg2JB7RQ2sliSZdNroJkv8-1sIA,4526
16
19
  sklearnex/covariance/tests/test_incremental_covariance.py,sha256=JIa4p-1_RYvU2ZVLx27iz0OKp0Nwrl9sYCsT0Dlyi2I,5402
17
20
  sklearnex/decomposition/__init__.py,sha256=RJBYDWyvnn5DA-j5r4IqVdXLp6H4mdPySsSjnXhlv-U,805
18
- sklearnex/decomposition/pca.py,sha256=68ksLxTP5fMOUhRmiIq9QNm0YzQanBNzxsq-zA8DKaY,809
19
- sklearnex/decomposition/tests/test_pca.py,sha256=aP4gxjML38CFpknwNVIkZLQCc8t2rqYGlWVo03vsMfE,1146
21
+ sklearnex/decomposition/pca.py,sha256=ffR22wH2n5R8SYflEmOPDPc-QpTomiAMOegV0IMbslg,12654
22
+ sklearnex/decomposition/tests/test_pca.py,sha256=FJYMosxpQpdOo71QD0jVx47oWEhvVNdut_5EOxTyT_0,2201
20
23
  sklearnex/doc/third-party-programs.txt,sha256=qA1XbOqYkMRnp29p8VxXjfcH0kHE8NSO5s2heea83-8,21773
21
24
  sklearnex/ensemble/__init__.py,sha256=2xB2KfG7l7uJv0p3kfVhrs4KLM174SCsigZhYqwSYAA,1035
22
- sklearnex/ensemble/_forest.py,sha256=nw_aUdgyjxKWc6yZ-8DBaqNqDODhx5uEy13GbpM7C18,70561
23
- sklearnex/ensemble/tests/test_forest.py,sha256=KoETKE1sSpKgp38s9bepAujJjcG21eFX5RyYINcHCUo,4516
25
+ sklearnex/ensemble/_forest.py,sha256=OHxqhYhkdjzhhEeWLlE0_IXBrWmKCUJoP_B1gQcmTQM,70002
26
+ sklearnex/ensemble/tests/test_forest.py,sha256=r1GSPQuVVuWYoNB3ZLiGKfMSwq3lp5i6k-Rgr7InonQ,4456
24
27
  sklearnex/glob/__main__.py,sha256=--FAjkhh5E6a1TFOGu6_BM3MHe78jP8oSpl0xKiRtTI,2531
25
28
  sklearnex/glob/dispatcher.py,sha256=IEEPhAOCVzC2JDFvYtijbiPAbaUY5RrCAhFLRjMMe1w,3018
26
29
  sklearnex/linear_model/__init__.py,sha256=5XZDZh8R0SmT8D8ZtSjW7-MKRO7l1jOZ8CUnt_OzHe4,1047
27
30
  sklearnex/linear_model/coordinate_descent.py,sha256=uZOHIKfFlHoMlNXZCh2MAnZE30fRZlmtcF7UsZQ3Vq4,822
28
- sklearnex/linear_model/linear.py,sha256=ed7pNKKnRkwa-wC0haUCOGHQoPkA4AuFhKNMzmRL6Fw,13832
31
+ sklearnex/linear_model/linear.py,sha256=0A2kCTpsGZK8IVkbIhYoAXqMAxHOyY7dO5JLxbNWmLw,11159
29
32
  sklearnex/linear_model/logistic_path.py,sha256=Nq3JPXSzE4bjamnP3gGQtsMKks2v7s6bSiuYRnFqrRw,849
30
- sklearnex/linear_model/logistic_regression.py,sha256=ezW717qpPM4EC6uvmKbvxZZZwkooLuc8mfddAu5ebJM,12547
33
+ sklearnex/linear_model/logistic_regression.py,sha256=6TRaDJ8nIHxjofIfUvmeJOP9_EwmUgVKKK1sxe9vS5A,14171
31
34
  sklearnex/linear_model/ridge.py,sha256=0oxlM5McYYvl0KxK9OIGJKM6lOADuFSPTdfx-efJNTI,810
32
- sklearnex/linear_model/tests/test_linear.py,sha256=li9LLWgap6YCwvNiHQ9yHduvUIsK1lpXfuVNR3dLwig,3200
33
- sklearnex/linear_model/tests/test_logreg.py,sha256=iH6pxRJ5Nh6RzO_ohFLlt-TpJpQmzKh2QMU81SnPwv4,3346
35
+ sklearnex/linear_model/tests/test_linear.py,sha256=kLoOcP9p0iCK2PhU438tGuPGuuBekF37FkA-YBcBMpM,4319
36
+ sklearnex/linear_model/tests/test_logreg.py,sha256=mUYDwTDUekERlzxjnVeOeCUcNv4KJAXdTIiELZNSaDc,3283
34
37
  sklearnex/manifold/__init__.py,sha256=3FU5fY1YvHAyNeSlUHsZfPnAbvlAUtZpum0Obmok2KE,809
35
38
  sklearnex/manifold/t_sne.py,sha256=U6F_dGB6taVuEJvTnVBWD-sri3x3m0Khu3HI4wXidhg,805
36
39
  sklearnex/manifold/tests/test_tsne.py,sha256=SNqe1yg45mL4qIsxpX5hDpBsIyrv9r__6wfrerjp3yU,1063
@@ -42,22 +45,19 @@ sklearnex/model_selection/__init__.py,sha256=64045Y-nzLDBepO6IRjt88LhL2DM3KdvpCF
42
45
  sklearnex/model_selection/split.py,sha256=qjmy8sRf_QEG8LhT0ivn_tICMCYmt7ffZZV1-rLQnko,824
43
46
  sklearnex/model_selection/tests/test_model_selection.py,sha256=3kZIq8kba8SW93DBWXupoRymNStR1_mGGYSErQRnwME,1338
44
47
  sklearnex/neighbors/__init__.py,sha256=_GMJ2L-6YechRYI2fOFwHjy0kebUncE81z4FmdXUlb8,1078
45
- sklearnex/neighbors/_lof.py,sha256=HddPA9VdHEKCENr260qEAWoaB3KdqVYqHE-BssSuWPY,6605
46
- sklearnex/neighbors/common.py,sha256=iia-EUIRUIohDCIGpHbVx2PeDlwUvz4Mj1Tn169jidA,10781
47
- sklearnex/neighbors/knn_classification.py,sha256=C0jqL9qRQwt31JTIxjjWQWJuiy_D1I5Am1_W6ek8beY,11077
48
- sklearnex/neighbors/knn_regression.py,sha256=7ihpIl5SKSYDGvXtsUC0vNaOTj6_NNpXAAsu3uiQuaQ,9978
49
- sklearnex/neighbors/knn_unsupervised.py,sha256=Stw63vAKiaHnPQ2cfnXWD1Omf-QssT4BqhFPCMmyVCs,7620
50
- sklearnex/neighbors/tests/test_neighbors.py,sha256=s4jip1Ntrhp5Zu9-pHVbeIoNdNFsq03ABY-N-iF_UL8,3437
51
- sklearnex/preview/__init__.py,sha256=1QcbV6xCSP7QCXRxYLVPc_b4lxE0cQiyTrMm4xOnosM,797
48
+ sklearnex/neighbors/_lof.py,sha256=5MPkWIb6FS55Q8xWzgc22Ec_PsouuN94SPovt-vsBGE,8648
49
+ sklearnex/neighbors/common.py,sha256=8DxDoYtXtEM4RNoMCimpTVSDOOxUIJlNVOQvBXBhkd4,10875
50
+ sklearnex/neighbors/knn_classification.py,sha256=ONoBbtwb5xoVLcpg5COpRNu1ZBOQ2EDh03RzbWDy5yo,8537
51
+ sklearnex/neighbors/knn_regression.py,sha256=YBjvh6h56OaJHSZNGq8ZV8lsB-XpSWduEcVeHRuPorQ,6692
52
+ sklearnex/neighbors/knn_unsupervised.py,sha256=qkj-hSEq8QetYsWlofnik3PpFvo1iBUbIOhywo8wFWk,5362
53
+ sklearnex/neighbors/tests/test_neighbors.py,sha256=gcJeJwDoT7wvyvk423k9TDGTGfbXUSTQETUT-VYQ74U,3409
54
+ sklearnex/preview/__init__.py,sha256=OXC_k2kudA13rVesXb5ZlEC7_mKUS7uUra_BR-Tin30,780
52
55
  sklearnex/preview/cluster/__init__.py,sha256=FONzOuTGAb5NwdfFhLco99P_VccRk9NBkDHU3EKuAIs,794
53
56
  sklearnex/preview/cluster/_common.py,sha256=bgpzijxgyrAtdNCCHyCNsZ-N70KQYNwMuoCTNdUna6o,2718
54
- sklearnex/preview/cluster/k_means.py,sha256=jSuU8E6r4fdbbBnxBpWp4ybBa62kCnbBx7zDXyUr0Cs,13007
57
+ sklearnex/preview/cluster/k_means.py,sha256=RdF9mwgvZ1xgyeLhCQA2WaPvPsS1ndktXXcaNj6S460,10464
55
58
  sklearnex/preview/covariance/__init__.py,sha256=DPYTk8lwcVphtwU8J3CyUYH8Uz6Zr0Uz4S6nn-RY5iM,825
56
- sklearnex/preview/covariance/covariance.py,sha256=LrNrGP62FEhTSBVaO-EOYAaq-Rszc1VS2B2IqMgh4oo,4938
57
- sklearnex/preview/covariance/tests/test_covariance.py,sha256=GYI4bMIhGnjmOXpt8J7R0JQmpm9eOvDjIphugRa4kD8,2140
58
- sklearnex/preview/decomposition/__init__.py,sha256=uRenwBGf7hHQqwAVYbBw3clUQB_HWUqJGOAKTuCnrcM,805
59
- sklearnex/preview/decomposition/pca.py,sha256=S8g5GhLdnUAb1FifNx6gnrwA8AWv8ddZtLY1Er83BkY,14342
60
- sklearnex/preview/decomposition/tests/test_preview_pca.py,sha256=xcllHM-jDIq33rAWTeh_gjhS2qfCNbUIAI5KeLPA8aY,1790
59
+ sklearnex/preview/covariance/covariance.py,sha256=NjRTWLie7UbpfN16wGSxJSRHRhUnvTn03cPPc8PpPd8,5131
60
+ sklearnex/preview/covariance/tests/test_covariance.py,sha256=FOgvhJxFQo9sNG4Uo-ebuw3ZXJ9tSxdk8qKm0ZJzTdc,2487
61
61
  sklearnex/spmd/__init__.py,sha256=ChQy2kEWlo4KGvs0RnbPoPEVhdgl8URV099B1rZtF5Y,889
62
62
  sklearnex/spmd/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
63
63
  sklearnex/spmd/basic_statistics/basic_statistics.py,sha256=_dQ9mhVYxeuChATEpAmHpXDpgW3YvtK1qrG-kLr2MtI,886
@@ -69,33 +69,33 @@ sklearnex/spmd/covariance/covariance.py,sha256=_oIlr1W1vqDHqIPnsCb04HcBCen5oBHQr
69
69
  sklearnex/spmd/decomposition/__init__.py,sha256=dBh0ZMIiaqdf3DKbt8FWNB2K9Iacs395m8OxaDFQg_M,784
70
70
  sklearnex/spmd/decomposition/pca.py,sha256=CUrsVD2jae-A9H8RB_emza_fe82CwnFa5PEy0fW_EZ8,871
71
71
  sklearnex/spmd/ensemble/__init__.py,sha256=B3yi7hWoVogMIiw0QRT_x5atsAFS-OO72YPLGeUQJ8M,873
72
- sklearnex/spmd/ensemble/forest.py,sha256=ao6lyzcxoRW-RG9xIYwtDFyM7JIjlF8wmQKpOv_oSRQ,3113
72
+ sklearnex/spmd/ensemble/forest.py,sha256=vIJJd10wIigFMtJMsiNDNLJ_PP2om-60zpQY_fd11-U,2909
73
73
  sklearnex/spmd/linear_model/__init__.py,sha256=WwqCr2DOyUnkSIHlP0yq0UI2yFDgSl5MHV7wu3QGJtA,893
74
74
  sklearnex/spmd/linear_model/linear_model.py,sha256=7QPCIQTWKBiZBTDZZbpZXi-REgxQCfRMt6rHPJAnc5E,883
75
75
  sklearnex/spmd/linear_model/logistic_regression.py,sha256=q_HkfWcg0RgFbk2t9FeV0ZY28HHAOtkGEnUj4tLuwt4,885
76
76
  sklearnex/spmd/neighbors/__init__.py,sha256=S16sH8N_18LN_8AgC_wGK5EDSNyuN-F-gI6GVlaiWVE,906
77
77
  sklearnex/spmd/neighbors/neighbors.py,sha256=SiKAS_RVt34MUcGytBS5pHnI_5vFNxJn8jqt1MOhDh8,940
78
78
  sklearnex/svm/__init__.py,sha256=f3e4ZFwZfx6MsXsn94VK1xVm6mWKT5XCiHczo6zNyAQ,1057
79
- sklearnex/svm/_common.py,sha256=Dt1Iyz1g04zOW6hn9cHa9ruzM_MHAIq0ZEEIxh5s7nI,7167
80
- sklearnex/svm/nusvc.py,sha256=Bvs_FmC1CYH23tXyrQE3Ti1h3BqK0YeX-_PBTZMRM0k,9008
81
- sklearnex/svm/nusvr.py,sha256=XHlDAGwnx1NVkkt8c9EUST8zVRLQY7Mwu335TPCcuRk,5237
82
- sklearnex/svm/svc.py,sha256=4f-vJlPGeAcquz7nkSCeu0LJTTXCbdU2M54HkT49TeQ,10288
83
- sklearnex/svm/svr.py,sha256=fmYi0dghOmmyFFVI59COX9-tyouQnSDfHIbs8GY8AHs,5241
79
+ sklearnex/svm/_common.py,sha256=52csEWTYWEVgUVWUm3RjX1VD_5VyyawXBvc7lBBp5qY,7010
80
+ sklearnex/svm/nusvc.py,sha256=J4F_Tm9oYC-WK1Nf_CNqSnvuYEEZZ9xa3VY-x0G_2cw,9871
81
+ sklearnex/svm/nusvr.py,sha256=ZFBnQzMgD4aRSk3BRIxwKfwErVyDJnNoR7vrIMm5WLk,3655
82
+ sklearnex/svm/svc.py,sha256=u9wQ8dsvQvO4XP_3JSfYFBNJcuDyv3HVG5NY6jZqhZk,11125
83
+ sklearnex/svm/svr.py,sha256=ldNWehrU4vgqX_0T8splmBjPsQln7w_h8L4XNpIgP6A,3655
84
84
  sklearnex/svm/tests/test_svm.py,sha256=Ru-aGNGCsRJts7SEEYbnKcVqUx-DqPyUtw-hEoMVpW8,4190
85
- sklearnex/tests/_models_info.py,sha256=xhjvnU3TvQg8J5Cih2hphWAOSsT8DnKmCyYbtwa0Qvs,4785
85
+ sklearnex/tests/_utils.py,sha256=hc3LxZDhlncONCGxqvWajQE7iVnSnt98Q9bem-KJDGI,5386
86
86
  sklearnex/tests/test_config.py,sha256=SnSJjxAAysISDyC3bYKSJiRHStkB9X-yjLeF11LpRog,1372
87
- sklearnex/tests/test_memory_usage.py,sha256=lwm63gSyRR82n3LGBdsophU_NvZK5RHkxAoTDZ2AcWI,7309
88
- sklearnex/tests/test_monkeypatch.py,sha256=wmtEeDNGoiPBlAh4Vmts86eFQLk8Wbzjbj6Busf6V3o,8663
89
- sklearnex/tests/test_n_jobs_support.py,sha256=ynfCSdCMnR3yEq1YEf_cilVD7zSe0sS-ZQ9jC0hHo8M,3903
90
- sklearnex/tests/test_parallel.py,sha256=bMu22noUvGiDX4oyxKIHPiOEoBP9lRQQUq6wq8ZD730,1776
91
- sklearnex/tests/test_patching.py,sha256=IySMpMdWVgoAZgs1cRKvdJeb8RXElFwjjNdHcE4jJz0,4247
87
+ sklearnex/tests/test_memory_usage.py,sha256=LwIuUgG7CUZ2kOk1XlxyaK7O3OlyoVwx40TgljaYs5Q,7327
88
+ sklearnex/tests/test_monkeypatch.py,sha256=_9s_4jFvbttOf8uCuBrS4rn_AzQdFlKyRlthnGacUcU,9669
89
+ sklearnex/tests/test_n_jobs_support.py,sha256=fNGlQz882qAJoJ56ymbID0hpIsO_7PHLmXxSew2JA_k,4124
90
+ sklearnex/tests/test_parallel.py,sha256=0zzlh2VJZWcHw5W4QSUthtAygOb6K0Bg1ekNsrdGJQE,1770
91
+ sklearnex/tests/test_patching.py,sha256=Gc4MChHY6lVUFkm3sgPF4RDd1uOqHQFfh9ac60d4vfQ,14299
92
92
  sklearnex/tests/test_run_to_run_stability_tests.py,sha256=4HDOeJruA1EDILbyQJtsHFmEXC0D1upSHuOT-KyTlEc,14008
93
- sklearnex/tests/utils/_launch_algorithms.py,sha256=pJT5tAW9rWvk7GT37R-B0-e8SLz8e9FSZw8yu4LWNJ4,3724
94
- sklearnex/utils/__init__.py,sha256=I8mbJQ3Zsm_F3sCLAhJQb7tUrG30kVsQ-wZoqA8vDdA,842
93
+ sklearnex/utils/__init__.py,sha256=FFlM8zc2qnSdPYpLjSt4Ma_9FjC8qk8wXJa-5B8hCs0,898
94
+ sklearnex/utils/_namespace.py,sha256=lWzvzcObxq350A-Ms8JyTbaQStR8rgH4DgQYhWruHL4,3166
95
95
  sklearnex/utils/parallel.py,sha256=VBcS-KUdyq7XpJUN6ygmNjyWtYLroghbvCxQ8nVU3YI,2085
96
96
  sklearnex/utils/validation.py,sha256=fjfhQiKnBQnD7LCBlacMyvsrhGnlMLRXk5Q69uoZIP4,827
97
- scikit_learn_intelex-2024.2.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
98
- scikit_learn_intelex-2024.2.0.dist-info/METADATA,sha256=nNiD7x2RPhuhzEKH-Hg0-iOk3kqAUlLd3f--6KmLP-c,12449
99
- scikit_learn_intelex-2024.2.0.dist-info/WHEEL,sha256=KUw5v0OkIti_FPHYLEMiqSBmUFpuC4n7PHRMpplWaA4,107
100
- scikit_learn_intelex-2024.2.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
101
- scikit_learn_intelex-2024.2.0.dist-info/RECORD,,
97
+ scikit_learn_intelex-2024.4.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
98
+ scikit_learn_intelex-2024.4.0.dist-info/METADATA,sha256=We3kZekomEyuXZpbrpq05hqphdjy8S5Q_geoj0Mb93c,12449
99
+ scikit_learn_intelex-2024.4.0.dist-info/WHEEL,sha256=KUw5v0OkIti_FPHYLEMiqSBmUFpuC4n7PHRMpplWaA4,107
100
+ scikit_learn_intelex-2024.4.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
101
+ scikit_learn_intelex-2024.4.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
@@ -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
@@ -200,9 +201,35 @@ def _copy_to_usm(queue, array):
200
201
  raise RuntimeError(
201
202
  "dpctl need to be installed to work " "with __sycl_usm_array_interface__"
202
203
  )
203
- mem = MemoryUSMDevice(array.nbytes, queue=queue)
204
- mem.copy_from_host(array.tobytes())
205
- return usm_ndarray(array.shape, array.dtype, buffer=mem)
204
+
205
+ if hasattr(array, "__array__"):
206
+
207
+ try:
208
+ mem = MemoryUSMDevice(array.nbytes, queue=queue)
209
+ mem.copy_from_host(array.tobytes())
210
+ return usm_ndarray(array.shape, array.dtype, buffer=mem)
211
+ except ValueError as e:
212
+ # ValueError will raise if device does not support the dtype
213
+ # retry with float32 (needed for fp16 and fp64 support issues)
214
+ # try again as float32, if it is a float32 just raise the error.
215
+ if array.dtype == np.float32:
216
+ raise e
217
+ return _copy_to_usm(queue, array.astype(np.float32))
218
+ else:
219
+ if isinstance(array, Iterable):
220
+ array = [_copy_to_usm(queue, i) for i in array]
221
+ return array
222
+
223
+
224
+ if dpnp_available:
225
+
226
+ def _convert_to_dpnp(array):
227
+ if isinstance(array, usm_ndarray):
228
+ return dpnp.array(array, copy=False)
229
+ elif isinstance(array, Iterable):
230
+ for i in range(len(array)):
231
+ array[i] = _convert_to_dpnp(array[i])
232
+ return array
206
233
 
207
234
 
208
235
  def wrap_output_data(func):
@@ -217,7 +244,7 @@ def wrap_output_data(func):
217
244
  if usm_iface is not None:
218
245
  result = _copy_to_usm(usm_iface["syclobj"], result)
219
246
  if dpnp_available and isinstance(data[0], dpnp.ndarray):
220
- result = dpnp.array(result, copy=False)
247
+ result = _convert_to_dpnp(result)
221
248
  return result
222
249
 
223
250
  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