scikit-learn-intelex 2025.7.0__py311-none-manylinux_2_28_x86_64.whl → 2025.9.0__py311-none-manylinux_2_28_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 (105) hide show
  1. daal4py/_daal4py.cpython-311-x86_64-linux-gnu.so +0 -0
  2. daal4py/mb/__init__.py +19 -8
  3. daal4py/mb/logistic_regression_builders.py +17 -23
  4. daal4py/mpi_transceiver.cpython-311-x86_64-linux-gnu.so +0 -0
  5. daal4py/sklearn/linear_model/logistic_loss.py +4 -4
  6. daal4py/sklearn/linear_model/logistic_path.py +170 -664
  7. daal4py/sklearn/monkeypatch/tests/_models_info.py +5 -2
  8. daal4py/sklearn/utils/validation.py +2 -2
  9. onedal/_device_offload.py +41 -40
  10. onedal/_onedal_py_dpc.cpython-311-x86_64-linux-gnu.so +0 -0
  11. onedal/_onedal_py_host.cpython-311-x86_64-linux-gnu.so +0 -0
  12. onedal/_onedal_py_spmd_dpc.cpython-311-x86_64-linux-gnu.so +0 -0
  13. onedal/basic_statistics/basic_statistics.py +52 -76
  14. onedal/basic_statistics/incremental_basic_statistics.py +26 -41
  15. onedal/basic_statistics/tests/test_basic_statistics.py +6 -7
  16. onedal/basic_statistics/tests/test_incremental_basic_statistics.py +11 -11
  17. onedal/cluster/dbscan.py +7 -25
  18. onedal/cluster/kmeans.py +1 -1
  19. onedal/common/hyperparameters.py +31 -11
  20. onedal/common/tests/test_sycl.py +5 -0
  21. onedal/covariance/covariance.py +7 -16
  22. onedal/covariance/incremental_covariance.py +13 -18
  23. onedal/covariance/tests/test_covariance.py +3 -3
  24. onedal/datatypes/__init__.py +6 -3
  25. onedal/datatypes/_data_conversion.py +97 -49
  26. onedal/datatypes/_dlpack.py +64 -0
  27. onedal/datatypes/_sycl_usm.py +9 -24
  28. onedal/datatypes/tests/test_data.py +85 -18
  29. onedal/decomposition/incremental_pca.py +39 -40
  30. onedal/decomposition/pca.py +49 -125
  31. onedal/decomposition/tests/test_incremental_pca.py +11 -5
  32. onedal/ensemble/forest.py +5 -5
  33. onedal/linear_model/incremental_linear_model.py +48 -160
  34. onedal/linear_model/linear_model.py +75 -188
  35. onedal/linear_model/logistic_regression.py +25 -11
  36. onedal/linear_model/tests/test_linear_regression.py +10 -17
  37. onedal/neighbors/neighbors.py +5 -4
  38. onedal/spmd/ensemble/forest.py +18 -0
  39. onedal/spmd/neighbors/__init__.py +2 -2
  40. onedal/spmd/neighbors/neighbors.py +30 -0
  41. onedal/tests/test_common.py +14 -0
  42. onedal/utils/_array_api.py +3 -0
  43. onedal/utils/_sycl_queue_manager.py +51 -25
  44. onedal/utils/_third_party.py +52 -2
  45. {scikit_learn_intelex-2025.7.0.dist-info → scikit_learn_intelex-2025.9.0.dist-info}/METADATA +84 -91
  46. {scikit_learn_intelex-2025.7.0.dist-info → scikit_learn_intelex-2025.9.0.dist-info}/RECORD +105 -104
  47. sklearnex/__init__.py +2 -1
  48. sklearnex/_config.py +0 -5
  49. sklearnex/_device_offload.py +13 -12
  50. sklearnex/_utils.py +31 -4
  51. sklearnex/basic_statistics/basic_statistics.py +26 -37
  52. sklearnex/basic_statistics/incremental_basic_statistics.py +33 -42
  53. sklearnex/cluster/dbscan.py +30 -27
  54. sklearnex/cluster/k_means.py +1 -0
  55. sklearnex/covariance/incremental_covariance.py +139 -98
  56. sklearnex/covariance/tests/test_incremental_covariance.py +30 -0
  57. sklearnex/decomposition/pca.py +356 -221
  58. sklearnex/decomposition/tests/test_pca.py +102 -53
  59. sklearnex/dispatcher.py +1 -6
  60. sklearnex/ensemble/_forest.py +8 -2
  61. sklearnex/ensemble/tests/test_forest.py +22 -7
  62. sklearnex/linear_model/coordinate_descent.py +2 -0
  63. sklearnex/linear_model/incremental_linear.py +76 -68
  64. sklearnex/linear_model/incremental_ridge.py +69 -53
  65. sklearnex/linear_model/linear.py +53 -41
  66. sklearnex/linear_model/logistic_regression.py +122 -38
  67. sklearnex/linear_model/ridge.py +42 -31
  68. sklearnex/linear_model/tests/test_linear.py +27 -61
  69. sklearnex/linear_model/tests/test_logreg.py +437 -6
  70. sklearnex/neighbors/common.py +8 -6
  71. sklearnex/preview/covariance/covariance.py +159 -28
  72. sklearnex/preview/covariance/tests/test_covariance.py +43 -50
  73. sklearnex/preview/decomposition/incremental_pca.py +251 -72
  74. sklearnex/preview/decomposition/tests/test_incremental_pca.py +55 -1
  75. sklearnex/spmd/basic_statistics/basic_statistics.py +7 -4
  76. sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +6 -3
  77. sklearnex/spmd/basic_statistics/tests/test_incremental_basic_statistics_spmd.py +12 -8
  78. sklearnex/spmd/cluster/dbscan.py +2 -26
  79. sklearnex/spmd/covariance/covariance.py +7 -4
  80. sklearnex/spmd/covariance/tests/test_covariance_spmd.py +18 -8
  81. sklearnex/spmd/covariance/tests/test_incremental_covariance_spmd.py +7 -2
  82. sklearnex/spmd/decomposition/pca.py +6 -4
  83. sklearnex/spmd/decomposition/tests/test_incremental_pca_spmd.py +2 -2
  84. sklearnex/spmd/decomposition/tests/test_pca_spmd.py +19 -6
  85. sklearnex/spmd/ensemble/forest.py +230 -2
  86. sklearnex/spmd/ensemble/tests/test_forest_spmd.py +21 -4
  87. sklearnex/spmd/linear_model/linear_model.py +7 -4
  88. sklearnex/spmd/linear_model/tests/test_incremental_linear_spmd.py +16 -8
  89. sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +12 -4
  90. sklearnex/spmd/neighbors/__init__.py +6 -2
  91. sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +136 -13
  92. sklearnex/svm/_common.py +71 -8
  93. sklearnex/svm/tests/test_svm.py +31 -0
  94. sklearnex/tests/test_common.py +0 -1
  95. sklearnex/tests/test_config.py +55 -6
  96. sklearnex/tests/test_hyperparameters.py +85 -17
  97. sklearnex/tests/test_memory_usage.py +1 -1
  98. sklearnex/tests/test_patching.py +18 -14
  99. sklearnex/tests/utils/base.py +3 -21
  100. sklearnex/utils/_array_api.py +136 -1
  101. sklearnex/utils/parallel.py +68 -30
  102. sklearnex/utils/validation.py +19 -1
  103. {scikit_learn_intelex-2025.7.0.dist-info → scikit_learn_intelex-2025.9.0.dist-info}/LICENSE.txt +0 -0
  104. {scikit_learn_intelex-2025.7.0.dist-info → scikit_learn_intelex-2025.9.0.dist-info}/WHEEL +0 -0
  105. {scikit_learn_intelex-2025.7.0.dist-info → scikit_learn_intelex-2025.9.0.dist-info}/top_level.txt +0 -0
daal4py/mb/__init__.py CHANGED
@@ -53,15 +53,26 @@ def convert_model(model) -> "GBTDAALModel | LogisticDAALModel":
53
53
  offers faster prediction methods.
54
54
  """
55
55
  if isinstance(model, LogisticRegression):
56
+ # The multi_class keyword is removed in scikit-learn 1.8, and OvR functionality
57
+ # has been replaced by other estimators. Therefore checking for linear classifiers
58
+ # only dependent on the solver.
56
59
  if model.classes_.shape[0] > 2:
57
- if (model.multi_class == "ovr") or (
58
- model.multi_class == "auto" and model.solver == "liblinear"
59
- ):
60
- raise TypeError(
61
- "Supplied 'model' object is a linear classifier, but not multinomial logistic"
62
- " (hint: pass multi_class='multinomial' to 'LogisticRegression')."
63
- )
64
- elif (model.classes_.shape[0] == 2) and (model.multi_class == "multinomial"):
60
+ if not hasattr(model, "multi_class"):
61
+ if model.solver == "liblinear":
62
+ raise TypeError(
63
+ "Supplied 'model' object is a linear classifier, but not multinomial logistic"
64
+ )
65
+ else:
66
+ if (model.multi_class == "ovr") or (
67
+ model.multi_class == "auto" and model.solver == "liblinear"
68
+ ):
69
+ raise TypeError(
70
+ "Supplied 'model' object is a linear classifier, but not multinomial logistic"
71
+ " (hint: pass multi_class='multinomial' to 'LogisticRegression')."
72
+ )
73
+ elif (model.classes_.shape[0] == 2) and (
74
+ getattr(model, "multi_class", "auto") == "multinomial"
75
+ ):
65
76
  raise TypeError(
66
77
  "Supplied 'model' object is not a logistic regressor "
67
78
  "(hint: pass multi_class='auto' to 'LogisticRegression')."
@@ -97,21 +97,6 @@ class LogisticDAALModel:
97
97
  )
98
98
  builder.set_beta(coefs, intercepts)
99
99
  self._model = builder.model
100
- self._alg_pred_class = logistic_regression_prediction(
101
- nClasses=self.n_classes_,
102
- fptype=self._fptype,
103
- resultsToEvaluate="computeClassLabels",
104
- )
105
- self._alg_pred_prob = logistic_regression_prediction(
106
- nClasses=self.n_classes_,
107
- fptype=self._fptype,
108
- resultsToEvaluate="computeClassProbabilities",
109
- )
110
- self._alg_pred_logprob = logistic_regression_prediction(
111
- nClasses=self.n_classes_,
112
- fptype=self._fptype,
113
- resultsToEvaluate="computeClassLogProbabilities",
114
- )
115
100
 
116
101
  @property
117
102
  def coef_(self):
@@ -121,6 +106,15 @@ class LogisticDAALModel:
121
106
  def intercept_(self):
122
107
  return self._model.Beta[:, 0]
123
108
 
109
+ def _logistic_regression_prediction(
110
+ self, X: np.ndarray, resultsToEvaluate: str
111
+ ) -> classifier_prediction_result:
112
+ return logistic_regression_prediction(
113
+ nClasses=self.n_classes_,
114
+ fptype=self._fptype,
115
+ resultsToEvaluate=resultsToEvaluate,
116
+ ).compute(X, self._model)
117
+
124
118
  def predict(self, X) -> np.ndarray:
125
119
  """
126
120
  Predict most probable class
@@ -133,7 +127,7 @@ class LogisticDAALModel:
133
127
  The most probable class, as integer indexes
134
128
  """
135
129
  return (
136
- self._alg_pred_class.compute(X, self._model)
130
+ self._logistic_regression_prediction(X, "computeClassLabels")
137
131
  .prediction.reshape(-1)
138
132
  .astype(int)
139
133
  )
@@ -151,7 +145,9 @@ class LogisticDAALModel:
151
145
  proba : array(n_samples, n_classes)
152
146
  The predicted probabilities for each class.
153
147
  """
154
- return self._alg_pred_prob.compute(X, self._model).probabilities
148
+ return self._logistic_regression_prediction(
149
+ X, "computeClassProbabilities"
150
+ ).probabilities
155
151
 
156
152
  predict_proba.__doc__ = predict_proba.__doc__.replace(r"%docstring_X%", _docstring_X)
157
153
 
@@ -166,7 +162,9 @@ class LogisticDAALModel:
166
162
  log_proba : array(n_samples, n_classes)
167
163
  The logarithms of the predicted probabilities for each class.
168
164
  """
169
- return self._alg_pred_logprob.compute(X, self._model).logProbabilities
165
+ return self._logistic_regression_prediction(
166
+ X, "computeClassLogProbabilities"
167
+ ).logProbabilities
170
168
 
171
169
  predict_log_proba.__doc__ = predict_log_proba.__doc__.replace(
172
170
  r"%docstring_X%", _docstring_X
@@ -206,11 +204,7 @@ class LogisticDAALModel:
206
204
  raise ValueError(
207
205
  "Must request at least one of 'classes', 'proba', 'log_proba'."
208
206
  )
209
- return logistic_regression_prediction(
210
- nClasses=self.n_classes_,
211
- fptype=self._fptype,
212
- resultsToEvaluate=pred_request,
213
- ).compute(X, self._model)
207
+ return self._logistic_regression_prediction(X, pred_request)
214
208
 
215
209
  predict_multiple.__doc__ = predict_multiple.__doc__.replace(
216
210
  r"%docstring_X%", _docstring_X
@@ -61,8 +61,8 @@ def _daal4py_logistic_loss_extra_args(
61
61
  fptype=getFPType(X),
62
62
  method="defaultDense",
63
63
  interceptFlag=fit_intercept,
64
- penaltyL1=l1 / n,
65
- penaltyL2=l2 / n,
64
+ penaltyL1=l1,
65
+ penaltyL2=l2,
66
66
  resultsToCompute=results_to_compute,
67
67
  )
68
68
  objective_function_algorithm_instance.setup(X, y, beta)
@@ -99,8 +99,8 @@ def _daal4py_cross_entropy_loss_extra_args(
99
99
  fptype=getFPType(X),
100
100
  method="defaultDense",
101
101
  interceptFlag=fit_intercept,
102
- penaltyL1=l1 / n,
103
- penaltyL2=l2 / n,
102
+ penaltyL1=l1,
103
+ penaltyL2=l2,
104
104
  resultsToCompute=results_to_compute,
105
105
  )
106
106
  )