scikit-learn-intelex 2024.6.0__py312-none-manylinux1_x86_64.whl → 2024.7.0__py312-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.
- {scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/METADATA +2 -2
- {scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/RECORD +55 -41
- sklearnex/_config.py +3 -15
- sklearnex/_device_offload.py +9 -168
- sklearnex/basic_statistics/basic_statistics.py +127 -1
- sklearnex/basic_statistics/tests/test_basic_statistics.py +251 -0
- sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +1 -1
- sklearnex/cluster/dbscan.py +0 -1
- sklearnex/cluster/k_means.py +8 -0
- sklearnex/cluster/tests/test_kmeans.py +15 -3
- sklearnex/covariance/incremental_covariance.py +64 -13
- sklearnex/covariance/tests/test_incremental_covariance.py +35 -0
- sklearnex/decomposition/pca.py +25 -1
- sklearnex/dispatcher.py +94 -0
- sklearnex/ensemble/_forest.py +8 -35
- sklearnex/ensemble/tests/test_forest.py +9 -12
- sklearnex/linear_model/coordinate_descent.py +13 -0
- sklearnex/linear_model/linear.py +2 -34
- sklearnex/linear_model/logistic_regression.py +79 -59
- sklearnex/linear_model/ridge.py +7 -0
- sklearnex/linear_model/tests/test_linear.py +28 -3
- sklearnex/linear_model/tests/test_logreg.py +45 -3
- sklearnex/manifold/t_sne.py +4 -0
- sklearnex/metrics/pairwise.py +5 -0
- sklearnex/metrics/ranking.py +3 -0
- sklearnex/model_selection/split.py +3 -0
- sklearnex/neighbors/_lof.py +9 -0
- sklearnex/neighbors/common.py +45 -1
- sklearnex/neighbors/knn_classification.py +1 -20
- sklearnex/neighbors/knn_regression.py +1 -20
- sklearnex/neighbors/knn_unsupervised.py +31 -7
- sklearnex/preview/__init__.py +1 -1
- sklearnex/preview/linear_model/__init__.py +19 -0
- sklearnex/preview/linear_model/ridge.py +419 -0
- sklearnex/preview/linear_model/tests/test_ridge.py +102 -0
- sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +107 -0
- sklearnex/spmd/cluster/tests/test_dbscan_spmd.py +97 -0
- sklearnex/spmd/cluster/tests/test_kmeans_spmd.py +172 -0
- sklearnex/spmd/covariance/tests/test_covariance_spmd.py +107 -0
- sklearnex/spmd/decomposition/tests/test_pca_spmd.py +128 -0
- sklearnex/spmd/ensemble/tests/test_forest_spmd.py +265 -0
- sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +145 -0
- sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py +163 -0
- sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +288 -0
- sklearnex/svm/_common.py +19 -21
- sklearnex/svm/tests/test_svm.py +12 -20
- sklearnex/tests/_utils.py +143 -20
- sklearnex/tests/_utils_spmd.py +185 -0
- sklearnex/tests/test_config.py +4 -0
- sklearnex/tests/test_monkeypatch.py +12 -4
- sklearnex/tests/test_patching.py +16 -13
- sklearnex/tests/test_run_to_run_stability.py +21 -9
- {scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/LICENSE.txt +0 -0
- {scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/WHEEL +0 -0
- {scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
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 numpy.testing import assert_allclose
|
|
19
|
+
from sklearn.datasets import make_blobs, make_classification, make_regression
|
|
20
|
+
from sklearn.model_selection import train_test_split
|
|
21
|
+
|
|
22
|
+
from onedal.tests.utils._dataframes_support import _as_numpy
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
import dpctl
|
|
26
|
+
from dpctl import SyclQueue
|
|
27
|
+
from mpi4py import MPI
|
|
28
|
+
|
|
29
|
+
mpi_libs_available = True
|
|
30
|
+
gpu_is_available = dpctl.has_gpu_devices()
|
|
31
|
+
except (ImportError, ModuleNotFoundError):
|
|
32
|
+
mpi_libs_available = False
|
|
33
|
+
|
|
34
|
+
_mpi_libs_and_gpu_available = mpi_libs_available and gpu_is_available
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _get_local_tensor(full_data):
|
|
38
|
+
"""Splits data across ranks.
|
|
39
|
+
|
|
40
|
+
Called on each rank to extract the subset of data assigned to that rank.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
full_data (numpy or dpctl array): The entire set of data
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
local_data (numpy or dpctl array): The subset of data used by the rank
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
# create sycl queue and gather communicator details
|
|
50
|
+
q = SyclQueue("gpu")
|
|
51
|
+
comm = MPI.COMM_WORLD
|
|
52
|
+
rank = comm.Get_rank()
|
|
53
|
+
size = comm.Get_size()
|
|
54
|
+
|
|
55
|
+
# divide data across ranks and move to dpt tensor
|
|
56
|
+
data_rows = full_data.shape[0]
|
|
57
|
+
local_start = rank * data_rows // size
|
|
58
|
+
local_end = (1 + rank) * data_rows // size
|
|
59
|
+
local_data = full_data[local_start:local_end]
|
|
60
|
+
|
|
61
|
+
return local_data
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _generate_regression_data(n_samples, n_features, dtype=np.float64, random_state=42):
|
|
65
|
+
# Generates regression data and divides between train and test
|
|
66
|
+
X, y = make_regression(
|
|
67
|
+
n_samples=n_samples, n_features=n_features, random_state=random_state
|
|
68
|
+
)
|
|
69
|
+
X = X.astype(dtype)
|
|
70
|
+
y = y.astype(dtype)
|
|
71
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state)
|
|
72
|
+
return X_train, X_test, y_train, y_test
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _generate_classification_data(
|
|
76
|
+
n_samples, n_features, n_classes=2, dtype=np.float64, random_state=42
|
|
77
|
+
):
|
|
78
|
+
# Generates classification data and divides between train and test
|
|
79
|
+
X, y = make_classification(
|
|
80
|
+
n_samples=n_samples,
|
|
81
|
+
n_features=n_features,
|
|
82
|
+
n_classes=n_classes,
|
|
83
|
+
n_informative=int(0.5 * n_classes + 1),
|
|
84
|
+
random_state=random_state,
|
|
85
|
+
)
|
|
86
|
+
X = X.astype(dtype)
|
|
87
|
+
y = y.astype(dtype)
|
|
88
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state)
|
|
89
|
+
return X_train, X_test, y_train, y_test
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _generate_statistic_data(n_samples, n_features, dtype=np.float64, random_state=42):
|
|
93
|
+
# Generates statistical data
|
|
94
|
+
gen = np.random.default_rng(random_state)
|
|
95
|
+
data = gen.uniform(low=-0.3, high=+0.7, size=(n_samples, n_features)).astype(dtype)
|
|
96
|
+
return data
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _generate_clustering_data(
|
|
100
|
+
n_samples, n_features, centers=None, dtype=np.float64, random_state=42
|
|
101
|
+
):
|
|
102
|
+
# Generates clustering data and divides between train and test
|
|
103
|
+
X, _ = make_blobs(
|
|
104
|
+
n_samples=n_samples,
|
|
105
|
+
centers=centers,
|
|
106
|
+
n_features=n_features,
|
|
107
|
+
random_state=random_state,
|
|
108
|
+
)
|
|
109
|
+
X = X.astype(dtype)
|
|
110
|
+
X_train, X_test = train_test_split(X, random_state=random_state)
|
|
111
|
+
return X_train, X_test
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _spmd_assert_allclose(spmd_result, batch_result, **kwargs):
|
|
115
|
+
"""Calls assert_allclose on spmd and batch results.
|
|
116
|
+
|
|
117
|
+
Called on each rank to compare the spmd result specific to that rank and
|
|
118
|
+
subset of batch result that corresponds to that rank.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
spmd_result (numpy or dpctl array): The result for the subset of data on the rank the function is called from, computed by the spmd estimator
|
|
122
|
+
batch_result (numpy array): The result for all data, computed by the batch estimator
|
|
123
|
+
|
|
124
|
+
Raises:
|
|
125
|
+
AssertionError: If all results are not adequately close.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
# extract chunk from batch result to match with local spmd result
|
|
129
|
+
local_batch_result = _get_local_tensor(batch_result)
|
|
130
|
+
|
|
131
|
+
assert_allclose(_as_numpy(spmd_result), _as_numpy(local_batch_result), **kwargs)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def _assert_unordered_allclose(spmd_result, batch_result, localize=False, **kwargs):
|
|
135
|
+
"""Checks if rows in spmd and batch results are aligned, even if not in the same order.
|
|
136
|
+
|
|
137
|
+
Called to verify correct unordered results are present. Useful to check KMeans centers
|
|
138
|
+
or KNN neighbors, where order does not matter. Sorts inputs to handle unordering. Also
|
|
139
|
+
capable of handling localization.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
spmd_result (numpy or dpctl array): Result computed by the spmd estimator
|
|
143
|
+
batch_result (numpy array): Result computed by batch estimator
|
|
144
|
+
localize (bool): Whether of not spmd result is specific to the rank, in which case batch result needs to be localized
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
AssertionError: If results do not match.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
sorted_spmd_result = spmd_result[np.argsort(np.linalg.norm(spmd_result, axis=1))]
|
|
151
|
+
if localize:
|
|
152
|
+
local_batch_result = _get_local_tensor(batch_result)
|
|
153
|
+
sorted_batch_result = local_batch_result[
|
|
154
|
+
np.argsort(np.linalg.norm(local_batch_result, axis=1))
|
|
155
|
+
]
|
|
156
|
+
else:
|
|
157
|
+
sorted_batch_result = batch_result[
|
|
158
|
+
np.argsort(np.linalg.norm(batch_result, axis=1))
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
assert_allclose(_as_numpy(sorted_spmd_result), sorted_batch_result, **kwargs)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def _assert_kmeans_labels_allclose(
|
|
165
|
+
spmd_labels, batch_labels, spmd_centers, batch_centers, **kwargs
|
|
166
|
+
):
|
|
167
|
+
"""Checks if labels for spmd and batch results are aligned, even cluster indices don't match.
|
|
168
|
+
|
|
169
|
+
Called to verify labels are assigned the same way on spmd and batch. Uses raw labels (which
|
|
170
|
+
may not match) to identify cluster center and ensure results match.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
spmd_labels (numpy or dpctl array): The labels for the subset of data on the rank the function is called from, computed by the spmd estimator
|
|
174
|
+
batch_labels (numpy array): The labels for all data, computed by the batch estimator
|
|
175
|
+
spmd_centers (numpy or dpctl array): Centers computed by the spmd estimator
|
|
176
|
+
batch_centers (numpy array): Centers computed by batch estimator
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
AssertionError: If clusters are not correctly assigned.
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
local_batch_labels = _get_local_tensor(batch_labels)
|
|
183
|
+
assert_allclose(
|
|
184
|
+
spmd_centers[_as_numpy(spmd_labels)], batch_centers[local_batch_labels], **kwargs
|
|
185
|
+
)
|
sklearnex/tests/test_config.py
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import sklearn
|
|
18
18
|
|
|
19
|
+
import onedal
|
|
19
20
|
import sklearnex
|
|
20
21
|
|
|
21
22
|
|
|
@@ -33,7 +34,10 @@ def test_set_config_works():
|
|
|
33
34
|
)
|
|
34
35
|
|
|
35
36
|
config = sklearnex.get_config()
|
|
37
|
+
onedal_config = onedal._config._get_config()
|
|
36
38
|
assert config["target_offload"] == "cpu:0"
|
|
37
39
|
assert config["allow_fallback_to_host"]
|
|
38
40
|
assert config["assume_finite"]
|
|
41
|
+
assert onedal_config["target_offload"] == "cpu:0"
|
|
42
|
+
assert onedal_config["allow_fallback_to_host"]
|
|
39
43
|
sklearnex.set_config(**default_config)
|
|
@@ -208,10 +208,11 @@ def test_preview_namespace():
|
|
|
208
208
|
from sklearn.cluster import DBSCAN
|
|
209
209
|
from sklearn.decomposition import PCA
|
|
210
210
|
from sklearn.ensemble import RandomForestClassifier
|
|
211
|
-
from sklearn.linear_model import LinearRegression
|
|
211
|
+
from sklearn.linear_model import LinearRegression, Ridge
|
|
212
212
|
from sklearn.svm import SVC
|
|
213
213
|
|
|
214
214
|
return (
|
|
215
|
+
Ridge(),
|
|
215
216
|
LinearRegression(),
|
|
216
217
|
PCA(),
|
|
217
218
|
DBSCAN(),
|
|
@@ -226,9 +227,12 @@ def test_preview_namespace():
|
|
|
226
227
|
|
|
227
228
|
assert _is_preview_enabled()
|
|
228
229
|
|
|
229
|
-
lr, pca, dbscan, svc, rfc = get_estimators()
|
|
230
|
+
ridge, lr, pca, dbscan, svc, rfc = get_estimators()
|
|
230
231
|
assert "sklearnex" in rfc.__module__
|
|
231
232
|
|
|
233
|
+
if daal_check_version((2024, "P", 600)):
|
|
234
|
+
assert "sklearnex.preview" in ridge.__module__
|
|
235
|
+
|
|
232
236
|
if daal_check_version((2023, "P", 100)):
|
|
233
237
|
assert "sklearnex" in lr.__module__
|
|
234
238
|
else:
|
|
@@ -242,7 +246,8 @@ def test_preview_namespace():
|
|
|
242
246
|
sklearnex.unpatch_sklearn()
|
|
243
247
|
|
|
244
248
|
# no patching behavior
|
|
245
|
-
lr, pca, dbscan, svc, rfc = get_estimators()
|
|
249
|
+
ridge, lr, pca, dbscan, svc, rfc = get_estimators()
|
|
250
|
+
assert "sklearn." in ridge.__module__ and "daal4py" not in ridge.__module__
|
|
246
251
|
assert "sklearn." in lr.__module__ and "daal4py" not in lr.__module__
|
|
247
252
|
assert "sklearn." in pca.__module__ and "daal4py" not in pca.__module__
|
|
248
253
|
assert "sklearn." in dbscan.__module__ and "daal4py" not in dbscan.__module__
|
|
@@ -254,7 +259,10 @@ def test_preview_namespace():
|
|
|
254
259
|
sklearnex.patch_sklearn()
|
|
255
260
|
assert not _is_preview_enabled()
|
|
256
261
|
|
|
257
|
-
lr, pca, dbscan, svc, rfc = get_estimators()
|
|
262
|
+
ridge, lr, pca, dbscan, svc, rfc = get_estimators()
|
|
263
|
+
|
|
264
|
+
assert "daal4py" in ridge.__module__
|
|
265
|
+
|
|
258
266
|
if daal_check_version((2023, "P", 100)):
|
|
259
267
|
assert "sklearnex" in lr.__module__
|
|
260
268
|
else:
|
sklearnex/tests/test_patching.py
CHANGED
|
@@ -43,6 +43,7 @@ from sklearnex.tests._utils import (
|
|
|
43
43
|
SPECIAL_INSTANCES,
|
|
44
44
|
UNPATCHED_FUNCTIONS,
|
|
45
45
|
UNPATCHED_MODELS,
|
|
46
|
+
call_method,
|
|
46
47
|
gen_dataset,
|
|
47
48
|
gen_models_info,
|
|
48
49
|
)
|
|
@@ -139,6 +140,9 @@ def test_standard_estimator_patching(caplog, dataframe, queue, dtype, estimator,
|
|
|
139
140
|
]:
|
|
140
141
|
pytest.skip(f"{estimator} does not support GPU queues")
|
|
141
142
|
|
|
143
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
144
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
145
|
+
|
|
142
146
|
if estimator == "TSNE" and method == "fit_transform":
|
|
143
147
|
pytest.skip("TSNE.fit_transform is too slow for common testing")
|
|
144
148
|
elif (
|
|
@@ -161,10 +165,8 @@ def test_standard_estimator_patching(caplog, dataframe, queue, dtype, estimator,
|
|
|
161
165
|
est.fit(X, y)
|
|
162
166
|
|
|
163
167
|
if method:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
else:
|
|
167
|
-
est.score(X, y)
|
|
168
|
+
call_method(est, method, X, y)
|
|
169
|
+
|
|
168
170
|
assert all(
|
|
169
171
|
[
|
|
170
172
|
"running accelerated version" in i.message
|
|
@@ -183,11 +185,15 @@ def test_special_estimator_patching(caplog, dataframe, queue, dtype, estimator,
|
|
|
183
185
|
with caplog.at_level(logging.WARNING, logger="sklearnex"):
|
|
184
186
|
est = SPECIAL_INSTANCES[estimator]
|
|
185
187
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
if queue:
|
|
189
|
+
# Its not possible to get the dpnp/dpctl arrays to be in the proper dtype
|
|
190
|
+
if dtype == np.float16 and not queue.sycl_device.has_aspect_fp16:
|
|
191
|
+
pytest.skip("Hardware does not support fp16 SYCL testing")
|
|
192
|
+
elif dtype == np.float64 and not queue.sycl_device.has_aspect_fp64:
|
|
193
|
+
pytest.skip("Hardware does not support fp64 SYCL testing")
|
|
194
|
+
|
|
195
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
196
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
191
197
|
|
|
192
198
|
X, y = gen_dataset(est, queue=queue, target_df=dataframe, dtype=dtype)[0]
|
|
193
199
|
est.fit(X, y)
|
|
@@ -196,10 +202,7 @@ def test_special_estimator_patching(caplog, dataframe, queue, dtype, estimator,
|
|
|
196
202
|
pytest.skip(f"sklearn available_if prevents testing {estimator}.{method}")
|
|
197
203
|
|
|
198
204
|
if method:
|
|
199
|
-
|
|
200
|
-
getattr(est, method)(X)
|
|
201
|
-
else:
|
|
202
|
-
est.score(X, y)
|
|
205
|
+
call_method(est, method, X, y)
|
|
203
206
|
|
|
204
207
|
assert all(
|
|
205
208
|
[
|
|
@@ -25,6 +25,7 @@ from _utils import (
|
|
|
25
25
|
PATCHED_MODELS,
|
|
26
26
|
SPECIAL_INSTANCES,
|
|
27
27
|
_sklearn_clone_dict,
|
|
28
|
+
call_method,
|
|
28
29
|
gen_dataset,
|
|
29
30
|
gen_models_info,
|
|
30
31
|
)
|
|
@@ -73,23 +74,23 @@ def eval_method(X, y, est, method):
|
|
|
73
74
|
est.fit(X, y)
|
|
74
75
|
|
|
75
76
|
if method:
|
|
76
|
-
|
|
77
|
-
res = getattr(est, method)(X)
|
|
78
|
-
else:
|
|
79
|
-
res = est.score(X, y)
|
|
77
|
+
res = call_method(est, method, X, y)
|
|
80
78
|
|
|
81
79
|
if not isinstance(res, Iterable):
|
|
82
|
-
|
|
80
|
+
results = [_as_numpy(res)] if res is not est else []
|
|
81
|
+
else:
|
|
82
|
+
results = [_as_numpy(i) for i in res]
|
|
83
|
+
|
|
84
|
+
attributes = [method] * len(results)
|
|
83
85
|
|
|
84
86
|
# if estimator follows sklearn design rules, then set attributes should have a
|
|
85
87
|
# trailing underscore
|
|
86
|
-
attributes
|
|
88
|
+
attributes += [
|
|
87
89
|
i
|
|
88
90
|
for i in dir(est)
|
|
89
91
|
if hasattr(est, i) and not i.startswith("_") and i.endswith("_")
|
|
90
92
|
]
|
|
91
|
-
results
|
|
92
|
-
attributes += [method for i in res]
|
|
93
|
+
results += [getattr(est, i) for i in attributes if i != method]
|
|
93
94
|
return results, attributes
|
|
94
95
|
|
|
95
96
|
|
|
@@ -148,8 +149,13 @@ STABILITY_INSTANCES = _sklearn_clone_dict(
|
|
|
148
149
|
def test_standard_estimator_stability(estimator, method, dataframe, queue):
|
|
149
150
|
if estimator in ["LogisticRegression", "TSNE"]:
|
|
150
151
|
pytest.skip(f"stability not guaranteed for {estimator}")
|
|
151
|
-
if estimator in ["KMeans", "PCA"] and
|
|
152
|
+
if estimator in ["KMeans", "PCA"] and "score" in method and queue == None:
|
|
152
153
|
pytest.skip(f"variation observed in {estimator}.score")
|
|
154
|
+
if estimator in ["IncrementalEmpiricalCovariance"] and method == "mahalanobis":
|
|
155
|
+
pytest.skip("allowed fallback to sklearn occurs")
|
|
156
|
+
|
|
157
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
158
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
153
159
|
|
|
154
160
|
est = PATCHED_MODELS[estimator]()
|
|
155
161
|
|
|
@@ -173,6 +179,8 @@ def test_special_estimator_stability(estimator, method, dataframe, queue):
|
|
|
173
179
|
pytest.skip(f"stability not guaranteed for {estimator}")
|
|
174
180
|
if "KMeans" in estimator and method == "score" and queue == None:
|
|
175
181
|
pytest.skip(f"variation observed in KMeans.score")
|
|
182
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
183
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
176
184
|
|
|
177
185
|
est = SPECIAL_INSTANCES[estimator]
|
|
178
186
|
|
|
@@ -194,6 +202,8 @@ def test_sparse_estimator_stability(estimator, method, dataframe, queue):
|
|
|
194
202
|
if "KMeans" in estimator and method == "score" and queue == None:
|
|
195
203
|
pytest.skip(f"variation observed in KMeans.score")
|
|
196
204
|
|
|
205
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
206
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
197
207
|
est = SPARSE_INSTANCES[estimator]
|
|
198
208
|
|
|
199
209
|
if method and not hasattr(est, method):
|
|
@@ -215,6 +225,8 @@ def test_sparse_estimator_stability(estimator, method, dataframe, queue):
|
|
|
215
225
|
def test_other_estimator_stability(estimator, method, dataframe, queue):
|
|
216
226
|
if "KMeans" in estimator and method == "score" and queue == None:
|
|
217
227
|
pytest.skip(f"variation observed in KMeans.score")
|
|
228
|
+
if "NearestNeighbors" in estimator and "radius" in method:
|
|
229
|
+
pytest.skip(f"RadiusNeighbors estimator not implemented in sklearnex")
|
|
218
230
|
|
|
219
231
|
est = STABILITY_INSTANCES[estimator]
|
|
220
232
|
|
{scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/LICENSE.txt
RENAMED
|
File without changes
|
|
File without changes
|
{scikit_learn_intelex-2024.6.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|