Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVM cpu/gpu interop #6089

Open
wants to merge 14 commits into
base: branch-25.02
Choose a base branch
from
25 changes: 10 additions & 15 deletions python/cuml/cuml/multiclass/multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,6 @@ def __init__(
self.strategy = strategy
self.estimator = estimator

@property
@cuml.internals.api_base_return_array_skipall
def classes_(self):
return self.multiclass_estimator.classes_

@property
@cuml.internals.api_base_return_any_skipall
def n_classes_(self):
return self.multiclass_estimator.n_classes_

@generate_docstring(y="dense_anydtype")
def fit(self, X, y) -> "MulticlassClassifier":
"""
Fit a multiclass classifier.
"""
if not has_sklearn():
raise ImportError(
"Scikit-learn is needed to use "
Expand All @@ -151,6 +136,16 @@ def fit(self, X, y) -> "MulticlassClassifier":
'{"ovr", "ovo"}'
)

@property
@cuml.internals.api_base_return_array_skipall
def classes_(self):
return self.multiclass_estimator.classes_

@generate_docstring(y="dense_anydtype")
def fit(self, X, y) -> "MulticlassClassifier":
"""
Fit a multiclass classifier.
"""
X = input_to_host_array_with_sparse_support(X)

y = input_to_host_array(y).array
Expand Down
4 changes: 2 additions & 2 deletions python/cuml/cuml/svm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from cuml.svm.svc import SVC
from cuml.svm.svc import SVC, cpuModelSVC
from cuml.svm.svr import SVR
from cuml.svm.linear_svc import LinearSVC
from cuml.svm.linear_svr import LinearSVR
Loading
Loading