Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Scikit-Learn · Class

SVC

SVC is a libsvm-based C-support vector classifier for binary and multiclass problems. It supports several kernels, with RBF as the default, and handles multiclass classification through one-vs-one models.

How it works

SVC learns a support-vector classifier using libsvm. It can apply linear, polynomial, RBF, sigmoid, precomputed, or callable kernels; multiclass classification is handled with one-vs-one models, and predictions require fitting the estimator first.

Syntax

class sklearn.svm.SVC(*, C=1.0, kernel='rbf', degree=3, gamma='scale', coef0=0.0, shrinking=True, probability='deprecated', tol=0.001, cache_size=200, class_weight=None, verbose=False, max_iter=-1, decision_function_shape='ovr', break_ties=False, random_state=None)

Parameters

NameTypeDescription
Cfloat, default=1.0Regularization parameter; must be strictly positive.
kernel{'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, default='rbf'Kernel type: linear, poly, rbf, sigmoid, precomputed, or callable.
degreeint, default=3Polynomial kernel degree; must be non-negative and is used with the poly kernel.
gamma{'scale', 'auto'} or float, default='scale'Kernel coefficient for rbf, poly, and sigmoid kernels.
coef0float, default=0.0Independent term in the kernel function.
shrinkingbool, default=TrueWhether to use the shrinking heuristic.
probabilitydeprecatedProbability estimation setting; the current stable page reports this parameter as deprecated.
tolfloat, default=0.001Tolerance for stopping criterion.
cache_sizefloat, default=200Kernel cache size in megabytes.
class_weightdict or 'balanced', default=NoneClass weights; None leaves classes unweighted.
verbosebool, default=FalseEnable verbose output.
max_iterint, default=-1Hard limit on iterations; -1 means no limit.

Returns

A fitted SVC estimator from fit; prediction methods return class labels or decision scores according to the selected method.

Key points

  • SVC is a support-vector classification estimator implemented with libsvm.
  • For multiple classes, SVC uses one-versus-one classification rather than one-versus-rest internally.
  • The gamma parameter controls the kernel coefficient for RBF, polynomial, and sigmoid kernels.
  • When kernel is omitted, SVC uses the RBF kernel by default.
  • A callable kernel computes a kernel matrix from pairs of input data matrices before fitting.

Common mistakes

  • Training can become impractical on datasets with tens of thousands of samples because fit time grows at least quadratically with sample count.
  • Increasing C weakens regularization, while decreasing it strengthens regularization; C must be strictly positive.
  • With a callable or precomputed kernel, provide a square training kernel matrix whose dimensions match the number of samples.

Example: Train an SVC classifier

from sklearn.svm import SVC
from sklearn.datasets import load_iris

X, y = load_iris(return_X_y=True)
model = SVC(kernel="rbf", gamma="scale", C=1.0)
model.fit(X, y)
print(model.predict(X[:3]))

This trains an RBF-kernel SVC on the Iris dataset and predicts labels for three samples.

When to use it

Nonlinear classification

Classifying labeled tabular data with nonlinear boundaries.

Kernel-based modeling

Using a linear, polynomial, RBF, or sigmoid similarity function.

Multiclass classification

Predicting among multiple target classes.

Interview questions

QWhat is SVC, and when can it be a poor choice?

SVC is a C-support vector classifier based on libsvm. Its fit-time complexity scales at least quadratically with the number of samples, so it may not suit very large datasets.

Follow-up: How does SVC handle multiclass classification? It uses a one-versus-one scheme, training binary classifiers for pairs of classes.

QWhat does the kernel parameter control?

The kernel selects the transformation or similarity function used by the algorithm. Supported choices include linear, polynomial, RBF, sigmoid, precomputed, and callable kernels; the default is RBF.

Follow-up: Which parameter controls the polynomial degree? The degree parameter controls the polynomial kernel degree and is ignored by other kernels.

QHow do C and gamma affect SVC?

C is the regularization parameter and must be strictly positive. Regularization strength varies inversely with C, while gamma is the kernel coefficient for RBF, polynomial, and sigmoid kernels.

Follow-up: What is gamma's default behavior? With gamma='scale', its value is derived from the input feature variance and feature count.

  • sklearn.svm.LinearSVC
  • sklearn.svm.NuSVC
  • sklearn.svm.SVR
  • sklearn.svm.OneClassSVM

Source: SVC. Checked 2026-10-15.