Support Vector Regression
Support vector regression fits the flattest function inside an epsilon-insensitive tube, tolerating small errors. Linear and kernel SVR explained.
4 min read · Updated August 8, 2026
Support Vector Regression (SVR) carries the maximal-margin idea of the support vector machine over to regression. The output is now a real number with infinitely many possible values, so the goal flips: instead of separating classes with the widest margin, fit a function that stays as flat as possible while keeping errors inside a tolerated band.
The epsilon-insensitive tube
Define a tube of half-width around the fitted function. Errors inside the tube are ignored entirely — only points outside it count, through the ε-insensitive loss:
For the linear case , SVR minimizes the flatness term plus a penalty on violations outside the tube, with slack variables absorbing the excess:
subject to

Two knobs shape the fit. ε sets the width of the indifference band — a larger ε tolerates more error and yields a flatter, smoother function. C trades flatness against tube violations — a larger C forces the function closer to the data. Only points on or outside the tube boundary contribute to the solution; these are the support vectors, which makes SVR robust to whatever happens deep inside the tube.
Non-linear SVR
When the relationship is curved, the kernel trick lifts the data into a higher-dimensional feature space where a linear tube fits — without ever computing the transformed coordinates. Because the optimization depends on the data only through inner products, any kernel function can stand in for them. The common choices are the same as for classification:
The RBF kernel is the default: it fits local, non-linear structure with a single width parameter to tune alongside and .
In practice
sklearn.svm.SVR (and the faster LinearSVR for large linear problems) implements ε-SVR with RBF, polynomial, and sigmoid kernels. Always scale features first — margin-based methods are scale-sensitive, so wrap the model in a Pipeline with StandardScaler. Tune the triple by grid search on cross-validated RMSE. SVR shines on small-to-medium datasets with smooth targets; on very large data it scales poorly (the kernel matrix is quadratic in ), where gradient-boosted trees or linear models on engineered features usually win.
Common pitfalls
- Unscaled features — the margin geometry is meaningless when one variable’s units dominate.
- Choosing ε without reference to the target’s scale: ε = 0.1 is generous for a target in [0, 1] and meaningless for one in thousands. Scale the target too, or set ε relative to its standard deviation.
- Huge C that chases every outlier, destroying the flatness that makes SVR robust.
- Expecting uncertainty bands — the ε-tube is a loss function, not a confidence interval; use quantile regression or Gaussian processes for calibrated intervals.
- Throwing SVR at millions of rows — kernel SVR training time grows roughly quadratically with .
Summary
Support vector regression fits the flattest function whose ε-insensitive tube contains the data, penalizing only outside-tube violations via slack variables and the complexity budget . Kernels extend the same tube to non-linear relationships. With proper scaling and a tuned , SVR is a robust, outlier-tolerant regressor for moderate-size problems.