DataPredict

API Reference - Models - NaiveBayes

NaiveBayes is an supervised machine learning model that predicts which classes that the input belongs to using probability.

Stored Model Parameters

Contains a table of matrices.

Constructors

new()

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

NaiveBayes.new(useLogProbabilities: boolean): 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.

NaiveBayes:setParameters(useLogProbabilities: boolean)

Parameters:

train()

Train the model.

NaiveBayes:train(featureMatrix: Matrix, labelVector: Matrix)

Parameters:

Returns:

predict()

Predict which cluster does it belong to for a given data.

NaiveBayes:predict(featureMatrix: Matrix, returnOriginalOutput: boolean): Matrix, Matrix -OR- Matrix

Parameters:

Returns:

-OR-

getClassesList()

NaiveBayes:getClassesList(): []

Returns:

setClassesList()

NaiveBayes:setClassesList(ClassesList: [])

Parameters:

Inherited From

Notes