SVC
API and practical guide for SVC in @kanaries/ml, including when to use it in JavaScript and TypeScript ML workflows.
SVM.SVC
Support Vector Classification. When the kernel is set to rbf it applies the kernel trick to transform input features before training a linear classifier.
interface SVCProps {
C?: number;
maxIter?: number;
learningRate?: number;
kernel?: 'linear' | 'rbf';
gamma?: number;
}
constructor(props: SVCProps = {})Parameters
C(number, default1): regularization strengthmaxIter(number, default100): maximum iterations for traininglearningRate(number, default0.01): step size for the optimizerkernel('linear' | 'rbf', default'rbf'): kernel typegamma(number, default1): RBF kernel coefficient
Example
const svc = new SVC({ kernel: 'linear' });
svc.fit(X, y);
const result = svc.predict(T);Practical guide: SVC in JavaScript and TypeScript
SVC trains kernelized support vector classifiers for non-linear decision boundaries.
When to use SVC
- Linear models underfit complex class separation patterns.
- You can afford kernel-based training for improved boundary flexibility.
- You need strong classification performance on medium-sized datasets.
Implementation workflow
- Scale features and pick a kernel (RBF is a common starting point).
- Fit with baseline hyperparameters and assess validation metrics.
- Tune
C, kernel settings, and class weights for task-specific goals.
JavaScript deployment notes
- Prefer feature scaling for distance-based and gradient-based algorithms to improve stability.
- In browser apps, run heavy training in Web Workers to keep UI interactions smooth.
- Keep a simple baseline from the same module as a fallback model for comparison.
Search intents this page targets
SVC JavaScriptSVC TypeScriptSVC browser machine learning@kanaries/ml SVC
FAQ
What problem does SVC solve in JavaScript machine learning projects?
SVC helps teams implement production-ready ML workflows in browser and Node.js environments with a familiar scikit-learn-style API.
When should I choose SVC instead of other SVM algorithms?
Use SVC when it best matches your data shape, labeling strategy, and runtime constraints. Benchmark against at least one alternative in the same module before finalizing defaults.
Can I run SVC in both browser and Node.js with @kanaries/ml?
Yes. @kanaries/ml is designed for JavaScript and TypeScript runtimes across browser applications, server-side Node.js services, and edge-friendly workflows.