8000 BUG use ValueError in BaseLibSVM.coef_ · seckcoder/scikit-learn@722fef6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 722fef6

Browse files
committed
BUG use ValueError in BaseLibSVM.coef_
NotImplementedError is for abstract methods.
1 parent 069bc0b commit 722fef6

File tree

< D054 span class="prc-TooltipV2-Tooltip-cYMVY" data-direction="se" aria-hidden="true" id=":R2atdab:">Expand file tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/svm/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def predict_log_proba(self, T):
113113
@property
114114
def coef_(self):
115115
if self.kernel != 'linear':
116-
raise NotImplementedError('coef_ is only available when using a '
117-
'linear kernel')
116+
raise ValueError('coef_ is only available when using a '
117+
'linear kernel')
118118
coef = safe_sparse_dot(self.dual_coef_, self.support_vectors_)
119119
# coef_ being a read-only property it's better to mark the value as
120120
# immutable to avoid hiding potential bugs for the unsuspecting user

0 commit comments

Comments
 (0)
0