kanber-bayes
Burak Kanber's implementation of a simple naive bayes classifier in javascript.
What?
This is a simple npm module for naive bayes classification. The code was originally written by Burak Kanber as part of a his "Machine Learning in Javascript" series. This repo represents an adaptation of the code from that article into a useful utility for node js or the browser.
You can read the original article here to learn more.
See the original jsFiddle implementation here.
Why?
The original code is a great learning tool for very basic natural language processing. It works well for extremely basic tasks, and there's no "black magic" behind the scenes. Use this module to learn from like I did, or use it in a project if you find it useful.
Installation
npm install kanber-bayes --save
Example Use
const Bayes = // init classifierconst classifier = // Train classifier to recognize Frenchclassifier;classifier; // Train classifier to recognize Englishclassifier;classifier; // guess the language of this sentenceclassifier// { french: 0.5, english: 0.8333333333333334 }