svm.NuSVC
Usage
import { NuSVC } from 'machinelearn/svm';
const svm = new NuSVC();
svm.loadASM().then((loadedSVM) => {
  loadedSVM.fit([[0, 0], [1, 1]], [0, 1]);
  loadedSVM.predict([[1, 1]]);   // [1]
});
Constructors
Properties
Methods
Constructors
constructor
⊕ NuSVC(options: `object`)
Defined in svm/classes.ts:289
Parameters:
| Param | Type | Default | Description | 
|---|
Returns: NuSVC
Properties
▸ options
Defined in svm/classes.ts:79
▸ svm
Defined in svm/classes.ts:78
Methods
λ fit
Fit the model according to the given training data.
Defined in svm/classes.ts:127
Parameters:
| Param | Type | Default | Description | 
|---|---|---|---|
| X | number[][] | ||
| y | number[] | 
Returns:
void
λ fromJSON
Restores the model from a JSON checkpoint
Defined in svm/classes.ts:171
Parameters:
| Param | Type | Default | Description | 
|---|---|---|---|
| options.options | any | null | |
| options.svm | any | null | 
Returns:
void
λ loadASM
Loads a ASM version of SVM. The method returns the instance of itself as a promise result.
Defined in svm/classes.ts:114
Returns:
🤘 Promise<self>
λ loadWASM
Loads a WASM version of SVM. The method returns the instance of itself as a promise result.
Defined in svm/classes.ts:104
Returns:
🤘 Promise<self>
λ predict
Predict using the linear model
Defined in svm/classes.ts:140
Parameters:
| Param | Type | Default | Description | 
|---|---|---|---|
| X | number[][] | 
Returns:
number[]
λ predictOne
Predict the label of one sample.
Defined in svm/classes.ts:150
Parameters:
| Param | Type | Default | Description | 
|---|---|---|---|
| X | number[] | 
Returns:
number
λ toJSON
Saves the current SVM as a JSON object
Defined in svm/classes.ts:159
Returns:
| Param | Type | Description | 
|---|