SVM Decision Function Calculator

Evaluate linear and kernel SVM decisions, inspect margins and contributions, compare classes, visualize boundaries, validate inputs, and export clear machine learning results with confidence.

Calculation Result

Formula and Steps


        

Model Setup

Choose a calculation mode. Then provide matching model parameters.

Linear SVM Inputs

Use commas or spaces between values.
Leave blank to calculate one sample.

Kernel SVM Inputs

Enter one support vector per line.

Manual Formula Inputs

One-vs-Rest Inputs

Enter one weight vector per class.

One-vs-One Inputs

Format: first class|second class|weights|intercept.

Preprocessing and Interpretation

Sparse format example: 1:2.4 3:-0.7.

Calculator Actions

Calculation History

No saved calculations yet.

Formula Used

A linear SVM uses f(x) = wᵀx + b. The sign selects a class. The magnitude measures boundary separation.

A kernel SVM sums weighted support-vector similarities. The intercept shifts the final decision. Kernel scores are not probabilities.

Signed distance equals f(x) / ||w|| for linear models. Margin width equals 2 / ||w||. Zero norm prevents distance calculation.

How to Use

Select the correct model mode. Enter vectors using commas or spaces. Keep every vector dimension consistent.

Choose preprocessing matching model training. Review warnings before trusting results. Then inspect contributions and margins.

Use examples for quick testing. Export results after validation. Calibrated probabilities require a separate method.

Example Data

ModeInputModelExpected use
Linear2.4, 1.3w = 0.8, -0.5; b = -0.2Feature contributions and distance
RBF1.2, 0.7Three support vectorsKernel similarity contributions
One-vs-Rest1.5, 0.8Three class modelsClass score comparison

Frequently Asked Questions

What does a positive SVM score mean?

It usually selects the configured positive class. Threshold settings can change that outcome. Class orientation must match training.

Is the decision score a probability?

No, it is an uncalibrated model score. Its magnitude reflects relative separation. Use calibration for probability estimates.

What does a score near zero mean?

The sample lies near the decision boundary. Small perturbations may change classification. Review preprocessing and model stability.

Why must vector lengths match?

Each weight corresponds to one feature. Different lengths break the dot product. Kernel vectors also require equal dimensions.

How does gamma scale work?

Scale uses feature count and observed variance. This calculator estimates variance from support vectors. Training data may differ.

What are support-vector contributions?

Each support vector adds a weighted similarity. Large magnitudes influence the score strongly. Signs determine direction.

When is signed distance available?

It is directly available for linear models. Linear kernels can reconstruct an equivalent weight vector. Other kernels lack one global hyperplane.

How are multiclass ties resolved?

One-vs-One first compares vote counts. Score totals can break remaining ties. Labels can provide deterministic fallback ordering.

Why does preprocessing matter?

SVM coefficients expect training-time feature scaling. Different scaling changes every decision score. Reuse identical preprocessing parameters.

Related Calculators

Support Vector Machine Margin CalculatorHyperplane Distance CalculatorKernel Function CalculatorRadial Basis Function Kernel CalculatorPolynomial Kernel Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.