Radial Basis Function Kernel Calculator

Explore RBF kernel similarity, tune gamma or sigma, scale features, generate matrices, inspect diagnostics, compare settings, and export clear machine learning results with confidence.

Calculator inputs

Enter vectors directly, paste datasets, or upload numeric CSV files.

Use commas, spaces, semicolons, or tabs.
Each line must contain the same feature count.
A first header row is allowed. Maximum size: 2 MB.

Formula used

K(x, z) = exp(−γ ||x − z||²)

The squared Euclidean distance measures separation between vectors. Gamma controls how rapidly similarity decreases. Identical vectors normally return a value of one.

K(x, z) = exp(−||x − z||² / (2σ²)),   γ = 1 / (2σ²)

How to use

  1. Enter two vectors with matching feature counts.
  2. Select gamma, sigma, auto, or scale mode.
  3. Choose scaling and distance behaviour.
  4. Paste datasets or upload CSV files.
  5. Calculate and inspect matrices, diagnostics, and charts.
  6. Copy, print, or export the results.

Example data

InputExamplePurpose
Vector X1, 2, 3Reference sample
Vector Z2, 3, 5Comparison sample
Gamma0.5Kernel width control
ScalingStandardisationBalances feature magnitudes
Dataset row4, 2, 1Pairwise matrix sample

Machine-learning guidance

Small gammaProduces wider similarity regions and smoother boundaries.
Large gammaProduces narrow similarity regions and more local behaviour.
Feature scalingPrevents large-range features from dominating distances.
Model tuningEvaluate gamma through validation rather than fixed labels.

Frequently asked questions

What does an RBF kernel measure?

It converts distance into a similarity score. Nearby samples receive larger values. Distant samples approach zero.

Why do identical vectors return one?

Their squared distance equals zero. The exponent therefore equals zero. The exponential of zero is one.

How does gamma affect results?

Gamma controls the similarity radius. Larger values create narrower influence. Smaller values create broader influence.

What is sigma?

Sigma expresses Gaussian kernel width. It is inversely related to gamma. Larger sigma values create wider kernels.

Should features be scaled?

Scaling is usually important for RBF models. Large numeric ranges can dominate distances. Compare several scaling methods carefully.

What does gamma auto mean?

Auto uses one divided by feature count. It is a simple baseline. Validation may find a better value.

What does gamma scale mean?

Scale also considers dataset variance. It adapts gamma to feature spread. Constant data falls back safely.

Is every RBF matrix positive semidefinite?

Standard Gaussian RBF matrices should be positive semidefinite. Floating-point error can create tiny negative eigenvalues. Tolerance handles those cases.

Can this replace model validation?

No calculator replaces proper validation. Use cross-validation for model selection. Treat similarity labels as descriptive guidance.

Related Calculators

Support Vector Machine Margin CalculatorHyperplane Distance CalculatorKernel Function CalculatorPolynomial Kernel CalculatorSVM Decision Function 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.