Naive bayes classifiers.
npm install ml-naivebayes
// assuming that you created Xtrain, Xtest, Ytrain, Ytest
import { GaussianNB } from 'ml-naivebayes';
var model = new GaussianNB();
model.train(Xtrain, Ytrain);
var predictions = model.predict(Xtest);
// assuming that you created Xtrain, Xtest, Ytrain, Ytest
import { MultinomialNB } from 'ml-naivebayes';
var model = new MultinomialNB();
model.train(Xtrain, Ytrain);
var predictions = model.predict(Xtest);