NaiveBayes is an supervised machine learning model that predicts which classes that the input belongs to using probability.
Contains a table of matrices.
ModelParameters[1]: meanMatrix. The columns are the features.
ModelParameters[2]: standardDeviationMatrix. The columns are the features.
ModelParameters[3]: probabilitiesMatrix. The columns are the features.
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
Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.
NaiveBayes:setParameters(useLogProbabilities: boolean)
Train the model.
NaiveBayes:train(featureMatrix: Matrix, labelVector: Matrix)
featureMatrix: Matrix containing all data.
labelVector: A (n x 1) matrix containing values related to featureMatrix.
Predict which cluster does it belong to for a given data.
NaiveBayes:predict(featureMatrix: Matrix, returnOriginalOutput: boolean): Matrix, Matrix -OR- Matrix
featureMatrix: Matrix containing all data.
returnOriginalOutput: Set whether or not to return predicted matrix instead of value with highest probability.
predictedVector: A vector that is predicted by the model.
probabilityVector: A vector that contains the probability of predicted values in predictedVector.
-OR-
NaiveBayes:getClassesList(): []
NaiveBayes:setClassesList(ClassesList: [])