NuSVC
API and practical guide for NuSVC in @kanaries/ml, including when to use it in JavaScript and TypeScript ML workflows.
SVM.NuSVC
Variant of SVC that uses the nu parameter to control the fraction of support vectors and the margin errors.
interface NuSVCProps {
nu?: number;
}
constructor(props: NuSVCProps = {})Parameters
nu(number, default0.5): trade-off between the number of support vectors and training errorsC(number, default1/nu): regularization strengthmaxIter(number, default100): maximum iterations for traininglearningRate(number, default0.01): step size for gradient descentkernel('linear' | 'rbf', default'rbf'): kernel typegamma(number, default1): RBF kernel coefficient
NuSVC shares the same usage as SVC but uses the nu parameter instead of C.
Practical guide: NuSVC in JavaScript and TypeScript
NuSVC provides SVM classification with nu-based control over support vector fraction and margin errors.
When to use NuSVC
- You prefer
nuconstraints over classicCtuning behavior. - Dataset boundaries require flexible kernel-based classification.
- You need explicit control over support-vector complexity.
Implementation workflow
- Choose kernel and initialize a conservative
nuvalue. - Fit NuSVC and inspect validation accuracy and support vector count.
- Tune kernel and nu jointly for generalization and runtime limits.
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
NuSVC JavaScriptNuSVC TypeScriptNuSVC browser machine learning@kanaries/ml NuSVC
FAQ
What problem does NuSVC solve in JavaScript machine learning projects?
NuSVC helps teams implement production-ready ML workflows in browser and Node.js environments with a familiar scikit-learn-style API.
When should I choose NuSVC instead of other SVM algorithms?
Use NuSVC 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 NuSVC 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.