Support vector regression
Quick answer
Support vector regression (SVR) predicts a numerical target. Epsilon-insensitive loss ignores small absolute errors inside a chosen tolerance tube and penalizes excess error outside it. Regularization controls the complexity of the fitted function. Static examples tested locally with Python 3.13.5, scikit-learn 1.8.0 and NumPy 2.3.5 where imported. ByteMind package execution is unverified.
Measure excess error
Observed local output:
[1.5, 0, 0, 1.0]The tolerance eliminates loss within the tube, not the underlying prediction error.
How it works
Define residual r=y-f(x). The epsilon-insensitive loss is max(0,|r|-epsilon) for epsilon>=0. If epsilon=0.5, errors -0.2 and 0.5 have zero loss, while an error -2 costs 1.5. Linear epsilon-SVR minimizes 0.5*||w||²+Csum(losses); in a kernel feature space the norm is the corresponding feature-space norm. The tube extends epsilon above and below the fitted curve, so its total thickness is 2epsilon in target units. In the dual formulation two nonnegative multipliers per observation account for the two sides of the tube; their difference weights a kernel similarity in the prediction. Support vectors generally determine the fitted function, not an uncertainty interval. Epsilon controls which training residuals count as violations, while C controls their cost. Increasing epsilon often reduces support-vector count but is not a universal rule. A target rescaled from seconds to milliseconds changes the meaning of epsilon and may require retuning C; feature scaling alone is insufficient to fix target units. SVR can use linear and nonlinear kernels. Compare to a mean or median baseline with a held-out metric such as MAE; the training epsilon loss is not identical to MAE. Extrapolation beyond the training region can be unreliable, especially for RBF.
Fit a linear SVR
from sklearn.svm import SVRm=SVR(kernel="linear",C=10,epsilon=0).fit([[0],[1],[2]],[1,3,5])print([round(float(v),3) for v in m.predict([[0.5],[1.5]])])Observed local output:
[2.0, 4.0]A linear function fits these noiseless observations; the interpolation is not proof of performance on noisy data.
Common mistakes
Do not call the epsilon tube a confidence interval or set epsilon based on final test residuals. Do not use classification accuracy for continuous targets. When comparing SVR with other regressors, use the same held-out observations and target units.
Practice and next steps
With residuals -2,-0.5,0,1.5 and epsilon=0.5, compute losses 1.5,0,0,1. Compare their mean with MAE. Fit the native example with a wider tube and inspect the predictions and support count. Complete the knowledge check and staged exercise. Next: Scaling and hyperparameter effects.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Support vector regression — knowledge check
Apply support vector regression to new scenarios.
Residual -3, epsilon=1: loss?
What units does epsilon use?
Does the tube give a confidence interval?
Which held-out metric fits numeric regression?
What can happen outside the training domain?