Skip to content

Commit

Permalink
Merge pull request #1569 from dantegd/012-fix-svm-sklearn
Browse files Browse the repository at this point in the history
[REVIEW] Remove Scikit-learn exception and dependency in SVM
  • Loading branch information
cjnolet authored Jan 17, 2020
2 parents a2c52fc + cb6af1c commit 784e7c6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
- PR #1557: Increasing threshold for kmeans score
- PR #1562: Increasing threshold even higher
- PR #1564: Fixed a typo in function cumlMPICommunicator_impl::syncStream
- PR #1569: Remove Scikit-learn exception and depedenncy in SVM

# cuML 0.11.0 (11 Dec 2019)

Expand Down
1 change: 0 additions & 1 deletion python/cuml/svm/svc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ from cuml.common.handle cimport cumlHandle
from cuml.utils import input_to_dev_array, zeros, get_cudf_column_ptr, \
device_array_from_ptr, get_dev_array_ptr
from libcpp cimport bool
from sklearn.exceptions import NotFittedError
from cuml.svm.svm_base import SVMBase

cdef extern from "cuml/matrix/kernelparams.h" namespace "MLCommon::Matrix":
Expand Down
5 changes: 2 additions & 3 deletions python/cuml/svm/svm_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ from cuml.common.handle cimport cumlHandle
from cuml.utils import input_to_dev_array, zeros, get_cudf_column_ptr, \
device_array_from_ptr, get_dev_array_ptr
from libcpp cimport bool
from sklearn.exceptions import NotFittedError

cdef extern from "cuml/matrix/kernelparams.h" namespace "MLCommon::Matrix":
enum KernelType:
Expand Down Expand Up @@ -286,7 +285,7 @@ class SVMBase(Base):
if self._c_kernel != LINEAR:
raise AttributeError("coef_ is only available for linear kernels")
if self._model is None:
raise NotFittedError("Call fit before prediction")
raise RuntimeError("Call fit before prediction")
if self._coef_ is None:
self._coef_ = self._calc_coef()
return self._coef_
Expand Down Expand Up @@ -499,7 +498,7 @@ class SVMBase(Base):
"""

if self._model is None:
raise NotFittedError("Call fit before prediction")
raise RuntimeError("Call fit before prediction")

cdef uintptr_t X_ptr
X_m, X_ptr, n_rows, n_cols, pred_dtype = \
Expand Down
1 change: 0 additions & 1 deletion python/cuml/svm/svr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ from cuml.common.handle cimport cumlHandle
from cuml.utils import input_to_dev_array, zeros, get_cudf_column_ptr, \
device_array_from_ptr, get_dev_array_ptr
from libcpp cimport bool
from sklearn.exceptions import NotFittedError
from cuml.svm.svm_base import SVMBase

cdef extern from "cuml/matrix/kernelparams.h" namespace "MLCommon::Matrix":
Expand Down

0 comments on commit 784e7c6

Please sign in to comment.