Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions docs/source/cuml-accel/limitations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -527,25 +527,13 @@ SVC
``CalibratedClassifierCV(SVC(), ensemble=False)`` instead. This will be
supported across ``scikit-learn`` versions, and won't require CPU fallback.

Additional notes:

- ONNX export via ``skl2onnx`` is not supported for this estimator.
- Using ``SVC`` in the same process as ``LinearSVC`` under ``cuml.accel`` can
cause a segfault.

SVR
^^^

``SVR`` will fall back to CPU in the following cases:

- If ``kernel="precomputed"`` or is a callable.

Additional notes:

- ONNX export via ``skl2onnx`` is not supported for this estimator.
- Using ``SVR`` in the same process as ``LinearSVR`` under ``cuml.accel`` can
cause a segfault.

LinearSVC
^^^^^^^^^

Expand Down
9 changes: 2 additions & 7 deletions python/cuml/cuml/accel/_overrides/sklearn/svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ def _has_probability(model):

class SVC(ProxyBase):
_gpu_class = cuml.svm.SVC
_not_implemented_attributes = frozenset(
(
"class_weight_",
"n_iter_",
)
)
_other_attributes = frozenset(("_gamma",))

def _gpu_fit(self, X, y, sample_weight=None):
classes = np.unique(np.asanyarray(y))
Expand All @@ -62,7 +57,7 @@ def predict_log_proba(self, X):

class SVR(ProxyBase):
_gpu_class = cuml.svm.SVR
_not_implemented_attributes = frozenset(("n_iter_",))
_other_attributes = frozenset(("_gamma",))


class LinearSVC(ProxyBase):
Expand Down
14 changes: 4 additions & 10 deletions python/cuml/cuml_accel_tests/test_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
xfail_unsupported = pytest.mark.xfail(
reason="not supported by skl2onnx", strict=True
)
xfail_proxy_private_attr = pytest.mark.xfail(
reason="skl2onnx accesses private attributes not exposed by the proxy",
strict=True,
)
xfail_skl2onnx_bug = pytest.mark.xfail(
reason="skl2onnx conversion error", strict=True
)
Expand Down Expand Up @@ -74,8 +70,10 @@ def regression_data():
pytest.param(LinearSVC(dual="auto"), id="LinearSVC"),
pytest.param(
SVC(kernel="linear"),
marks=xfail_proxy_private_attr,
id="SVC",
marks=pytest.mark.filterwarnings(
"ignore:Attribute `prob[A|B]_` was deprecated:FutureWarning"
),
),
pytest.param(
OneVsOneClassifier(LinearSVC(dual="auto")),
Expand All @@ -96,11 +94,7 @@ def regression_data():
),
pytest.param(KNeighborsRegressor(), id="KNeighborsRegressor"),
pytest.param(LinearSVR(dual="auto"), id="LinearSVR"),
pytest.param(
SVR(kernel="linear"),
marks=xfail_proxy_private_attr,
id="SVR",
),
pytest.param(SVR(kernel="linear"), id="SVR"),
]

transformers = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@
marker: cuml_accel_invalid_sklearn_tests
tests:
- "sklearn.model_selection.tests.test_search::test_grid_search_score_method"
- "sklearn.svm.tests.test_svm::test_gamma_scale"
- "sklearn.svm.tests.test_svm::test_svc_raises_error_internal_representation"
- reason: This test asserts a copy hasn't happened, but that's not actually guaranteed by the interface.
marker: cuml_accel_invalid_sklearn_tests
Expand Down
Loading