scikit-learn-intelex 2024.1.0__py38-none-manylinux1_x86_64.whl → 2024.3.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.
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/METADATA +2 -2
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/RECORD +45 -44
- sklearnex/__init__.py +9 -7
- sklearnex/cluster/dbscan.py +6 -4
- sklearnex/conftest.py +63 -0
- sklearnex/{preview/decomposition → covariance}/__init__.py +19 -19
- sklearnex/covariance/incremental_covariance.py +130 -0
- sklearnex/covariance/tests/test_incremental_covariance.py +143 -0
- sklearnex/decomposition/pca.py +322 -1
- sklearnex/decomposition/tests/test_pca.py +34 -5
- sklearnex/dispatcher.py +91 -59
- sklearnex/ensemble/_forest.py +15 -24
- sklearnex/ensemble/tests/test_forest.py +15 -19
- sklearnex/linear_model/__init__.py +1 -2
- sklearnex/linear_model/linear.py +3 -10
- sklearnex/{preview/linear_model → linear_model}/logistic_regression.py +32 -40
- sklearnex/linear_model/tests/test_logreg.py +70 -7
- sklearnex/neighbors/__init__.py +1 -1
- sklearnex/neighbors/_lof.py +204 -0
- sklearnex/neighbors/knn_classification.py +13 -18
- sklearnex/neighbors/knn_regression.py +12 -17
- sklearnex/neighbors/knn_unsupervised.py +10 -15
- sklearnex/neighbors/tests/test_neighbors.py +12 -16
- sklearnex/preview/__init__.py +1 -1
- sklearnex/preview/cluster/k_means.py +3 -8
- sklearnex/preview/covariance/covariance.py +46 -12
- sklearnex/spmd/__init__.py +1 -0
- sklearnex/{preview/linear_model → spmd/covariance}/__init__.py +5 -5
- sklearnex/spmd/covariance/covariance.py +21 -0
- sklearnex/spmd/ensemble/forest.py +4 -12
- sklearnex/spmd/linear_model/__init__.py +2 -1
- sklearnex/spmd/linear_model/logistic_regression.py +21 -0
- sklearnex/svm/nusvc.py +9 -6
- sklearnex/svm/nusvr.py +6 -7
- sklearnex/svm/svc.py +9 -6
- sklearnex/svm/svr.py +3 -4
- sklearnex/tests/_utils.py +155 -0
- sklearnex/tests/test_memory_usage.py +9 -7
- sklearnex/tests/test_monkeypatch.py +179 -138
- sklearnex/tests/test_n_jobs_support.py +71 -9
- sklearnex/tests/test_parallel.py +6 -8
- sklearnex/tests/test_patching.py +321 -82
- sklearnex/neighbors/lof.py +0 -436
- sklearnex/preview/decomposition/pca.py +0 -376
- sklearnex/preview/decomposition/tests/test_preview_pca.py +0 -42
- sklearnex/preview/linear_model/tests/test_preview_logistic_regression.py +0 -59
- sklearnex/tests/_models_info.py +0 -170
- sklearnex/tests/utils/_launch_algorithms.py +0 -118
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/LICENSE.txt +0 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/WHEEL +0 -0
- {scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# ==============================================================================
|
|
2
|
-
# Copyright 2021 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 logging
|
|
18
|
-
import random
|
|
19
|
-
|
|
20
|
-
import numpy as np
|
|
21
|
-
|
|
22
|
-
from sklearnex import patch_sklearn
|
|
23
|
-
|
|
24
|
-
patch_sklearn()
|
|
25
|
-
|
|
26
|
-
import pathlib
|
|
27
|
-
import sys
|
|
28
|
-
|
|
29
|
-
from sklearn.datasets import load_diabetes, load_iris, make_regression
|
|
30
|
-
from sklearn.metrics import pairwise_distances, roc_auc_score
|
|
31
|
-
|
|
32
|
-
absolute_path = str(pathlib.Path(__file__).parent.absolute())
|
|
33
|
-
sys.path.append(absolute_path + "/../")
|
|
34
|
-
from _models_info import MODELS_INFO, TYPES
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def get_class_name(x):
|
|
38
|
-
return x.__class__.__name__
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def generate_dataset(name, dtype, model_name):
|
|
42
|
-
if model_name == "LinearRegression":
|
|
43
|
-
X, y = make_regression(n_samples=1000, n_features=5)
|
|
44
|
-
elif name in ["blobs", "classifier"]:
|
|
45
|
-
X, y = load_iris(return_X_y=True)
|
|
46
|
-
elif name == "regression":
|
|
47
|
-
X, y = load_diabetes(return_X_y=True)
|
|
48
|
-
else:
|
|
49
|
-
raise ValueError("Unknown dataset type")
|
|
50
|
-
X = np.array(X, dtype=dtype)
|
|
51
|
-
y = np.array(y, dtype=dtype)
|
|
52
|
-
return (X, y)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def run_patch(model_info, dtype):
|
|
56
|
-
print(get_class_name(model_info["model"]), dtype.__name__)
|
|
57
|
-
X, y = generate_dataset(
|
|
58
|
-
model_info["dataset"], dtype, get_class_name(model_info["model"])
|
|
59
|
-
)
|
|
60
|
-
model = model_info["model"]
|
|
61
|
-
model.fit(X, y)
|
|
62
|
-
logging.info("fit")
|
|
63
|
-
for i in model_info["methods"]:
|
|
64
|
-
if i == "predict":
|
|
65
|
-
model.predict(X)
|
|
66
|
-
elif i == "predict_proba":
|
|
67
|
-
model.predict_proba(X)
|
|
68
|
-
elif i == "predict_log_proba":
|
|
69
|
-
model.predict_log_proba(X)
|
|
70
|
-
elif i == "decision_function":
|
|
71
|
-
model.decision_function(X)
|
|
72
|
-
elif i == "fit_predict":
|
|
73
|
-
model.fit_predict(X)
|
|
74
|
-
elif i == "transform":
|
|
75
|
-
model.transform(X)
|
|
76
|
-
elif i == "fit_transform":
|
|
77
|
-
model.fit_transform(X)
|
|
78
|
-
elif i == "kneighbors":
|
|
79
|
-
model.kneighbors(X)
|
|
80
|
-
elif i == "score":
|
|
81
|
-
model.score(X, y)
|
|
82
|
-
else:
|
|
83
|
-
raise ValueError(i + " is wrong method")
|
|
84
|
-
logging.info(i)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def run_algotithms():
|
|
88
|
-
for info in MODELS_INFO:
|
|
89
|
-
for t in TYPES:
|
|
90
|
-
model_name = get_class_name(info["model"])
|
|
91
|
-
if model_name in ["Ridge", "LinearRegression"] and t.__name__ == "uint32":
|
|
92
|
-
continue
|
|
93
|
-
run_patch(info, t)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def run_utils():
|
|
97
|
-
# pairwise_distances
|
|
98
|
-
for metric in ["cosine", "correlation"]:
|
|
99
|
-
for t in TYPES:
|
|
100
|
-
X = np.random.rand(1000)
|
|
101
|
-
X = np.array(X, dtype=t)
|
|
102
|
-
print("pairwise_distances", t.__name__)
|
|
103
|
-
_ = pairwise_distances(X.reshape(1, -1), metric=metric)
|
|
104
|
-
logging.info("pairwise_distances")
|
|
105
|
-
# roc_auc_score
|
|
106
|
-
for t in [np.float32, np.float64]:
|
|
107
|
-
a = [random.randint(0, 1) for i in range(1000)]
|
|
108
|
-
b = [random.randint(0, 1) for i in range(1000)]
|
|
109
|
-
a = np.array(a, dtype=t)
|
|
110
|
-
b = np.array(b, dtype=t)
|
|
111
|
-
print("roc_auc_score", t.__name__)
|
|
112
|
-
_ = roc_auc_score(a, b)
|
|
113
|
-
logging.info("roc_auc_score")
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if __name__ == "__main__":
|
|
117
|
-
run_algotithms()
|
|
118
|
-
run_utils()
|
{scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/LICENSE.txt
RENAMED
|
File without changes
|
|
File without changes
|
{scikit_learn_intelex-2024.1.0.dist-info → scikit_learn_intelex-2024.3.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|