Inferensys

Glossary

One-Class SVM

An unsupervised support vector machine algorithm that learns a decision boundary around the majority of normal data points in a high-dimensional kernel space, classifying any point falling outside this boundary as an anomaly.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
UNSUPERVISED ANOMALY DETECTION

What is One-Class SVM?

A support vector machine variant that learns a tight decision boundary around normal data to identify outliers.

A One-Class SVM is an unsupervised support vector machine algorithm that learns a decision boundary enclosing the majority of normal training data in a high-dimensional kernel space, classifying any point falling outside this boundary as an anomaly. It operates by mapping input vectors into a feature space via a kernel function and then finding the maximal-margin hyperplane that separates the data from the origin.

The algorithm's core hyperparameter, nu, controls the upper bound on the fraction of training errors and the lower bound on the fraction of support vectors, effectively setting the expected outlier ratio. By leveraging the kernel trick with radial basis functions, it captures complex, non-linear normality boundaries without explicit density estimation, making it effective for high-dimensional fraud detection where anomalies are sparse and heterogeneous.

CORE MECHANISMS

Key Features of One-Class SVM

One-Class SVM learns a tight decision boundary around normal data in a high-dimensional kernel space, treating the origin as the only outlier example. Below are its defining architectural and operational characteristics.

01

Origin as the Outlier Class

Unlike binary SVM, One-Class SVM treats the origin of the feature space as the sole representative of the anomaly class. The algorithm constructs a maximum-margin hyperplane that separates the mapped training data from the origin with the widest possible margin. This geometric trick allows the model to learn a compact boundary around normal data without requiring labeled fraud examples.

  • The ν (nu) parameter controls the fraction of training points allowed to fall between the hyperplane and the origin
  • Points on the wrong side of the decision boundary are classified as anomalies
  • This formulation is equivalent to finding the minimum-volume hypersphere enclosing the data in kernel space
02

Kernel Trick for Non-Linear Boundaries

One-Class SVM projects data into a high-dimensional reproducing kernel Hilbert space where complex, non-linear decision boundaries become linear. The Radial Basis Function kernel is the most common choice for financial fraud detection, as it can model the intricate, non-linear manifolds of legitimate transaction behavior.

  • RBF kernel: Captures local density variations; parameter γ controls the radius of influence of each support vector
  • Polynomial kernel: Models higher-order feature interactions for structured deviation patterns
  • Linear kernel: Used when the feature space is already high-dimensional or interpretability is critical
  • The kernel choice directly impacts the model's ability to separate subtle fraud patterns from normal variance
03

The ν (Nu) Hyperparameter

The ν parameter is the central tuning knob of One-Class SVM, simultaneously controlling two critical properties. It sets an upper bound on the fraction of margin errors and a lower bound on the fraction of support vectors.

  • ν ∈ (0, 1] defines the expected outlier proportion in the training set
  • A ν of 0.01 means the model expects approximately 1% contamination
  • Lower ν values create tighter boundaries, increasing sensitivity but risking overfitting
  • Higher ν values produce looser boundaries, trading false negatives for false positives
  • In fraud detection, ν is typically set conservatively low (0.001–0.05) to reflect the rarity of known fraud
04

Support Vectors Define the Boundary

The final model is sparse: only the training points lying on or within the margin—the support vectors—define the decision function. All other points are discarded, making inference computationally efficient.

  • Support vectors are the critical normal instances that shape the boundary
  • Points far inside the boundary contribute zero weight to the decision function
  • The number of support vectors grows with ν and the complexity of the data distribution
  • A high support vector ratio indicates a complex, potentially overfit boundary
  • This sparsity is a key advantage over density-based methods like Kernel Density Estimation for large-scale scoring
05

Anomaly Scoring via Decision Function

New transactions are scored using the signed distance to the separating hyperplane in kernel space. The decision function returns a real-valued score where negative values indicate anomalies and positive values indicate normal instances.

  • f(x) = sign(Σ αᵢ K(xᵢ, x) - ρ) where ρ is the offset and αᵢ are dual coefficients
  • The magnitude of the score reflects confidence: more negative = more anomalous
  • Scores can be calibrated into probability estimates using Platt scaling or isotonic regression
  • Threshold tuning on a validation set is essential to balance precision and recall for operational deployment
  • Unlike Isolation Forest, the score is a continuous distance metric, not a path length
06

Training Assumptions and Limitations

One-Class SVM assumes the training data is predominantly normal with minimal contamination. It is sensitive to outliers in the training set, which can distort the learned boundary. The algorithm also scales poorly to massive datasets due to its quadratic memory complexity.

  • Training complexity: O(n²) to O(n³) depending on the solver; impractical beyond ~100,000 samples without approximations
  • Sensitivity to scaling: Features must be standardized; the RBF kernel is not scale-invariant
  • Contamination robustness: Even 1-2% anomalies in training can significantly warp the boundary
  • For large-scale financial data, consider Stochastic Gradient Descent One-Class SVM or Isolation Forest as alternatives
  • Works best when normal behavior is stationary and well-sampled
ONE-CLASS SVM CLARIFIED

Frequently Asked Questions

Precise answers to the most common technical questions about the One-Class Support Vector Machine algorithm, its operational mechanics, and its application in unsupervised anomaly detection.

A One-Class Support Vector Machine (OC-SVM) is an unsupervised learning algorithm that learns a decision boundary tightly encapsulating the majority of 'normal' training data points in a high-dimensional feature space, classifying any point falling outside this boundary as an anomaly. It works by implicitly mapping input vectors into a higher-dimensional space via a kernel function (typically a Radial Basis Function, or RBF) and then finding a maximal-margin hyperplane that separates the origin from the mapped training data. The algorithm solves a constrained quadratic optimization problem where the hyperparameter ν (nu) controls an upper bound on the fraction of training errors and a lower bound on the fraction of support vectors, effectively tuning the sensitivity of the model to outliers in the training set itself.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.