Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cd3bfe

Browse files
mandjevantglemaitre
authored andcommitted
DOC svm add callable as accepted type for kernel parameter (#21675)
1 parent 10236a4 commit 2cd3bfe

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

sklearn/svm/_classes.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,9 @@ class SVC(BaseSVC):
538538
inversely proportional to C. Must be strictly positive. The penalty
539539
is a squared l2 penalty.
540540
541-
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'}, default='rbf'
541+
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, \
542+
default='rbf'
542543
Specifies the kernel type to be used in the algorithm.
543-
It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or
544-
a callable.
545544
If none is given, 'rbf' will be used. If a callable is given it is
546545
used to pre-compute the kernel matrix from data matrices; that matrix
547546
should be an array of shape ``(n_samples, n_samples)``.
@@ -795,10 +794,9 @@ class NuSVC(BaseSVC):
795794
<nu_svc>`) and a lower bound of the fraction of support vectors.
796795
Should be in the interval (0, 1].
797796
798-
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'}, default='rbf'
797+
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, \
798+
default='rbf'
799799
Specifies the kernel type to be used in the algorithm.
800-
It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or
801-
a callable.
802800
If none is given, 'rbf' will be used. If a callable is given it is
803801
used to precompute the kernel matrix.
804802
@@ -1053,10 +1051,9 @@ class SVR(RegressorMixin, BaseLibSVM):
10531051
10541052
Parameters
10551053
----------
1056-
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'}, default='rbf'
1054+
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, \
1055+
default='rbf'
10571056
Specifies the kernel type to be used in the algorithm.
1058-
It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or
1059-
a callable.
10601057
If none is given, 'rbf' will be used. If a callable is given it is
10611058
used to precompute the kernel matrix.
10621059
@@ -1252,10 +1249,9 @@ class NuSVR(RegressorMixin, BaseLibSVM):
12521249
C : float, default=1.0
12531250
Penalty parameter C of the error term.
12541251
1255-
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'}, default='rbf'
1252+
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, \
1253+
default='rbf'
12561254
Specifies the kernel type to be used in the algorithm.
1257-
It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or
1258-
a callable.
12591255
If none is given, 'rbf' will be used. If a callable is given it is
12601256
used to precompute the kernel matrix.
12611257
@@ -1430,10 +1426,9 @@ class OneClassSVM(OutlierMixin, BaseLibSVM):
14301426
14311427
Parameters
14321428
----------
1433-
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'}, default='rbf'
1429+
kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, \
1430+
default='rbf'
14341431
Specifies the kernel type to be used in the algorithm.
1435-
It must be one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed' or
1436-
a callable.
14371432
If none is given, 'rbf' will be used. If a callable is given it is
14381433
used to precompute the kernel matrix.
14391434

0 commit comments

Comments
 (0)