Support Vector Classifier

../../../../_images/svm.svg

Support vector machine (SVM) based classifier

Configuration:

  • C

    Penalty parameter C of the error term.

  • kernel

    Specifies the kernel type to be used in the algorithm. It must be one of ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable. If none is given, ‘rbf’ will be used. If a callable is given it is used to pre-compute the kernel matrix from data matrices; that matrix should be an array of shape (n_samples, n_samples).

  • degree

    Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.

  • gamma

    Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.

    Current default is ‘auto’ which uses 1 / n_features, if gamma='scale' is passed then it uses 1 / (n_features * X.std()) as value of gamma. The current default of gamma, ‘auto’, will change to ‘scale’ in version 0.22. ‘auto_deprecated’, a deprecated version of ‘auto’ is used as a default indicating that no explicit value of gamma was passed.

  • coef0

    Independent term in kernel function. It is only significant in ‘poly’ and ‘sigmoid’.

  • probability

    Whether to enable probability estimates. This must be enabled prior to calling fit, and will slow down that method.

  • shrinking

    Whether to use the shrinking heuristic.

  • tol

    Tolerance for stopping criterion.

  • class_weight

    Set the parameter C of class i to class_weight[i]*C for SVC. If not given, all classes are supposed to have weight one. The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classes * np.bincount(y))

  • max_iter

    Hard limit on iterations within solver, or -1 for no limit.

  • random_state

    The seed of the pseudo random number generator used when shuffling the data for probability estimates. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Attributes:

  • support_

    Indices of support vectors.

  • support_vectors_

    Support vectors.

  • n_support_

    Number of support vectors for each class.

  • dual_coef_

    Coefficients of the support vector in the decision function. For multiclass, coefficient for all 1-vs-1 classifiers. The layout of the coefficients in the multiclass case is somewhat non-trivial. See the section about multi-class classification in the SVM section of the User Guide for details.

  • coef_

    Coefficients of the support vector in the decision function. For multiclass, coefficient for all 1-vs-1 classifiers. The layout of the coefficients in the multiclass case is somewhat non-trivial. See the section about multi-class classification in the SVM section of the User Guide for details.

  • intercept_

    Constants in decision function.

Input ports:

Output ports:
model : model
Model
C (C)
Penalty parameter C of the error term.
kernel (kernel)
Specifies the kernel type to be used in the algorithm. It must be one of ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable. If none is given, ‘rbf’ will be used. If a callable is given it is used to pre-compute the kernel matrix from data matrices; that matrix should be an array of shape (n_samples, n_samples).
degree (degree)
Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.
gamma (gamma)

Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.

Current default is ‘auto’ which uses 1 / n_features, if gamma='scale' is passed then it uses 1 / (n_features * X.std()) as value of gamma. The current default of gamma, ‘auto’, will change to ‘scale’ in version 0.22. ‘auto_deprecated’, a deprecated version of ‘auto’ is used as a default indicating that no explicit value of gamma was passed.

coef0 (coef0)
Independent term in kernel function. It is only significant in ‘poly’ and ‘sigmoid’.
probability (probability)
Whether to enable probability estimates. This must be enabled prior to calling fit, and will slow down that method.
shrinking (shrinking)
Whether to use the shrinking heuristic.
tol (tol)
Tolerance for stopping criterion.
class_weight (class_weight)
Set the parameter C of class i to class_weight[i]*C for SVC. If not given, all classes are supposed to have weight one. The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classes * np.bincount(y))
max_iter (max_iter)
Hard limit on iterations within solver, or -1 for no limit.
random_state (random_state)
The seed of the pseudo random number generator used when shuffling the data for probability estimates. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Some of the docstrings for this module have been automatically extracted from the scikit-learn library and are covered by their respective licenses.

class node_svc.SupportVectorClassifier[source]