DataPredict

API Reference - Models - SupportVectorMachine

SupportVectorMachine is a supervised machine learning model that predicts values of -1 and 1 only.

Stored Model Parameters

Contains a matrix.

Constructors

new()

Create new model object. If any of the arguments are nil, default argument values for that argument will be used.

SupportVectorMachine.new(maximumNumberOfIterations: integer, cValue: number, kernelFunction: string, kernelParameters: table): ModelObject

Parameters:

Returns:

Functions

setParameters()

Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.

SupportVectorMachine:setParameters(maximumNumberOfIterations: integer, cValue: number, kernelFunction: string, kernelParameters: table)

Parameters:

setCValue()

Set how hard the margin should be.

SupportVectorMachine:setCValue(cValue: number)

Parameters:

train()

Train the model.

SupportVectorMachine:train(featureMatrix: Matrix, labelVector: Matrix): number[]

Parameters:

Returns:

predict()

Predict the values for given data.

SupportVectorMachine:predict(featureMatrix: Matrix, returnOriginalOutput): Matrix -OR- Matrix

Parameters:

Returns:

-OR-

Inherited From

References