Skip to content

Commit

Permalink
Linear Regression out of preview (#1557)
Browse files Browse the repository at this point in the history
* changing import to preview

* test_preview_linear upd

* no assert daal4py in module

* actual removal

* address public and private CI fails

* cleanup additional mentions of preview

* isorted

* minor paths update

* adding pytest args to function

* alignment with #1508

* Update sklearnex/tests/test_memory_usage.py

Co-authored-by: Alexander Andreev <[email protected]>

* Update sklearnex/tests/test_memory_usage.py

Co-authored-by: Alexander Andreev <[email protected]>

* some cpu deselected test removals

* restoring one deselected for pub CI

* restoring one deselected for private CI

* temp debugging

* another temp for debug

* debug removal

* alphabetical tweak after merging

* minor space

* deselected pca tweak

---------

Co-authored-by: Alexander Andreev <[email protected]>
  • Loading branch information
ethanglaser and Alexsandruss authored Nov 15, 2023
1 parent d437d54 commit 2f0d2db
Show file tree
Hide file tree
Showing 12 changed files with 395 additions and 495 deletions.
5 changes: 1 addition & 4 deletions deselected_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,10 @@ deselected_tests:
- tests/test_multioutput.py::test_multi_output_classification

# Linear Regression - badly defined equation system
- ensemble/tests/test_stacking.py::test_stacking_prefit[StackingRegressor-DummyRegressor-predict-final_estimator1-X1-y1]
- tests/test_common.py::test_estimators[RandomForestClassifier()-check_requires_y_none]
- tests/test_common.py::test_estimators[RandomForestRegressor()-check_requires_y_none]
- tests/test_common.py::test_estimators[LinearRegression()-check_requires_y_none]

# Linear Regression - minor mismatches in error/warning messages
- tree/tests/test_export.py::test_precision
- model_selection/tests/test_search.py::test_grid_search_pipeline_steps
- linear_model/tests/test_base.py::test_linear_regression_pd_sparse_dataframe_warning

Expand Down Expand Up @@ -1192,7 +1189,7 @@ gpu:
- tests/test_common.py::test_check_n_features_in_after_fitting[DBSCAN()]
- tests/test_common.py::test_check_n_features_in_after_fitting[SVC()]
# originated with pca dpctl/dpnp fit, to be re-assesed with pca out-of-preview
- test_pca_n_components_mostly_explained_variance_ratio
- decomposition/tests/test_pca.py::test_pca_n_components_mostly_explained_variance_ratio

preview:
- cluster/tests/test_k_means.py::test_kmeans_elkan_results
Expand Down
1 change: 0 additions & 1 deletion setup_sklearnex.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"sklearnex.preview",
"sklearnex.preview.cluster",
"sklearnex.preview.decomposition",
"sklearnex.preview.linear_model",
"sklearnex.svm",
"sklearnex.utils",
]
Expand Down
32 changes: 16 additions & 16 deletions sklearnex/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_patch_map():
from .ensemble import ExtraTreesRegressor as ExtraTreesRegressor_sklearnex
from .ensemble import RandomForestClassifier as RandomForestClassifier_sklearnex
from .ensemble import RandomForestRegressor as RandomForestRegressor_sklearnex
from .linear_model import LinearRegression as LinearRegression_sklearnex
from .neighbors import KNeighborsClassifier as KNeighborsClassifier_sklearnex
from .neighbors import KNeighborsRegressor as KNeighborsRegressor_sklearnex
from .neighbors import LocalOutlierFactor as LocalOutlierFactor_sklearnex
Expand All @@ -76,7 +77,6 @@ def get_patch_map():
# Preview classes for patching
from .preview.cluster import KMeans as KMeans_sklearnex
from .preview.decomposition import PCA as PCA_sklearnex
from .preview.linear_model import LinearRegression as LinearRegression_sklearnex
from .svm import SVC as SVC_sklearnex
from .svm import SVR as SVR_sklearnex
from .svm import NuSVC as NuSVC_sklearnex
Expand All @@ -88,21 +88,6 @@ def get_patch_map():
mapping.pop("pca")
mapping["pca"] = [[(decomposition_module, "PCA", PCA_sklearnex), None]]

# Linear Regression
mapping.pop("linear")
mapping.pop("linearregression")
mapping["linear"] = [
[
(
linear_model_module,
"LinearRegression",
LinearRegression_sklearnex,
),
None,
]
]
mapping["linearregression"] = mapping["linear"]

# KMeans
mapping.pop("kmeans")
mapping["kmeans"] = [
Expand All @@ -128,6 +113,21 @@ def get_patch_map():
mapping["nusvr"] = [[(svm_module, "NuSVR", NuSVR_sklearnex), None]]
mapping["nusvc"] = [[(svm_module, "NuSVC", NuSVC_sklearnex), None]]

# Linear Regression
mapping.pop("linear")
mapping.pop("linearregression")
mapping["linear"] = [
[
(
linear_model_module,
"LinearRegression",
LinearRegression_sklearnex,
),
None,
]
]
mapping["linearregression"] = mapping["linear"]

# kNN
mapping.pop("knn_classifier")
mapping.pop("kneighborsclassifier")
Expand Down
Loading

0 comments on commit 2f0d2db

Please sign in to comment.