DataPredict

API Reference - Others - OneVsAll

Allows binary classification models (such as LogisticRegression) be merged together to form multi-class models.

Constructors

new()

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

OneVsAll.new(maxNumberOfIterations: integer, useNegativeOneBinaryLabel: boolean): OneVsAllObject

Parameters:

Returns:

Functions

setParameters()

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

OneVsAll:setParameters(maxNumberOfIterations: integer, useNegativeOneBinaryLabel: boolean)

Parameters:

setModels()

Sets the model and number of classes to be used by the OneVsAll object. Leaving it empty will clear the model.

OneVsAll:setModels(modelName: string, numberOfClasses: integer)

Parameters:

setOptimizer()

Sets the optimizer and its parameters. Leaving it empty will clear the optimizer.

OneVsAll:setOptimizer(optimizerName: string, ...)

Parameters:

setRegularizer()

Sets the regularizer and its parameters. Leaving it empty will clear the optimizer.

OneVsAll:setRegularizer(lambda: number, regularizationMode: string, hasBias: boolean)

Parameters:

setModelsSettings()

OneVsAll:setModelsSettings(...: any)

Parameters:

train()

Train the model.

NeuralNetwork:train(featureMatrix: Matrix, labelVector / labelMatrix: Matrix): number[]

Parameters:

Returns:

predict()

Predict the values for given data.

OneVsAll:predict(featureMatrix: Matrix): Matrix, Matrix

Parameters:

Returns:

getClassesList()

OneVsAll:getClassesList(): []

Returns:

setClassesList()

OneVsAll:setClassesList(ClassesList: [])

Parameters:

getModelParametersArray()

Gets the model parameters from the base model.

OneVsAll:getModelParametersArray(doNotDeepCopy: boolean): ModelParameters []

Parameters

Returns

setModelParametersArray()

Set the model parameters to the base model.

OneVsAll:setModelParameters(ModelParametersArray: ModelParameters[], doNotDeepCopy: boolean)

Parameters

clearModelParameters()

Clears the model parameters stored inside the models.

OneVsAll:clearModelParameters()

setNumberOfIterationsToCheckIfConverged()

Set the number of iterations needed to confirm convergence for each model.

OneVsAll:setNumberOfIterationsToCheckIfConverged(numberOfIterations: number)

Parameters

setNumberOfIterationsToCheckIfConvergedForOneVsAll()

Set the number of iterations needed to confirm convergence.

OneVsAll:setNumberOfIterationsToCheckIfConvergedForOneVsAll(numberOfIterations: number)

Parameters

setTargetCost()

Set the upper bound and lower bounds of the target cost for each model.

OneVsAll:setTargetCost(upperBound: number, lowerBound: number)

Parameters

setTargetTotalCost()

Set the upper bound and lower bounds of the target cost.

OneVsAll:setTargetTotalCost(upperBound: number, lowerBound: number)

Parameters

setAutoResetOptimizers()

Set if the optimizer resets at the end of iterations.

OneVsAll:setAutoResetOptimizers(option: boolean)

Parameters:

setPrintOutput()

Set if the OneVsAll object prints output.

OneVsAll:setPrintOutput(option: boolean)

Parameters: