__init__(self,
input_dim=None,
output_dim=None,
dtype=None,
**kwargs)
(Constructor)
|
|
C-Support Vector Classification.
This node has been automatically generated by wrapping the scikits.learn.svm.classes.SVC class
from the sklearn library. The wrapped instance can be accessed
through the scikits_alg attribute.
Parameters
- C : float, optional (default=1.0)
- penalty parameter C of the error term.
- kernel : string, optional
- Specifies the kernel type to be used in the algorithm.
one of 'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'.
If none is given 'rbf' will be used.
- degree : int, optional
- degree of kernel function
is significant only in poly, rbf, sigmoid
- gamma : float, optional
- kernel coefficient for rbf and poly, by default 1/n_features
will be taken.
- coef0 : float, optional
- independent term in kernel function. It is only significant
in poly/sigmoid.
- probability: boolean, optional (False by default)
- enable probability estimates. This must be enabled prior
to calling prob_predict.
- shrinking: boolean, optional
- wether to use the shrinking heuristic.
- tol: float, optional
- precision for stopping criteria
- cache_size: float, optional
- specify the size of the cache (in MB)
Attributes
support_ : array-like, shape = [n_SV]
- Index of support vectors.
support_vectors_ : array-like, shape = [n_SV, n_features]
- Support vectors.
n_support_ : array-like, dtype=int32, shape = [n_class]
- number of support vector for each class.
dual_coef_ : array, shape = [n_class-1, n_SV]
- Coefficients of the support vector in the decision function.
coef_ : array, shape = [n_class-1, n_features]
- Weights asigned to the features (coefficients in the primal
problem). This is only available in the case of linear kernel.
intercept_ : array, shape = [n_class * (n_class-1) / 2]
- Constants in decision function.
Examples
>>> import numpy as np
>>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
>>> y = np.array([1, 1, 2, 2])
>>> from scikits.learn.svm import SVC
>>> clf = SVC()
>>> clf.fit(X, y)
SVC(kernel='rbf', C=1.0, probability=False, degree=3, coef0=0.0, tol=0.001,
cache_size=100.0, shrinking=True, gamma=0.25)
>>> print clf.predict([[-0.8, -1]])
[ 1.]
See also
SVR, LinearSVC
- Overrides:
object.__init__
|