4.0.0
Constructor for the Gaussian Naive Bayes classifier, the parameters here is just for loading purposes.
function that predicts each row of the dataset (must be a matrix).
((Matrix | Array))
Array
:
Function that export the NaiveBayes model.
object
:
Function that trains the classifier with a matrix that represents the training set and an array that represents the label of each row in the training set. the labels must be numbers between 0 to n-1 where n represents the number of classes.
WARNING: in the case that one class, all the cases in one or more features have the same value, the Naive Bayes classifier will not work well.
Function that create a GaussianNB classifier with the given model.
(object)
GaussianNB
:
Constructor for Multinomial Naive Bayes, the model parameter is for load purposes.
(object)
for load purposes.
Retrieves the predictions for the dataset with the current model.
((Matrix | Array))
Array
:
predictions from the dataset.
Function that saves the current model.
object
:
model in JSON format.
Train the classifier with the current training set and labels, the labels must be numbers between 0 and n.
Creates a new MultinomialNB from the given model
(object)
MultinomialNB
: