logistic-regression
This is an implementation of the logistic regression. When there are more than 2 classes, the method used is the One VS All.
Installation
$ npm i ml-logistic-regression
Usage
const Matrix = ; // Our training set (X,Y).const X = 0 -1 1 0 1 1 1 -1 2 0 2 1 2 -1 3 2 0 4 1 3 1 4 1 5 2 3 2 4 2 5 3 4 1 10 1 12 2 10 2 11 2 14 3 11;const Y = Matrix; // The test set (Xtest, Ytest).const Xtest = 0 -2 1 05 15 -1 1 25 2 35 15 4 1 105 25 105 2 115;const Ytest = Matrix; // We will train our model.const logreg = numSteps: 1000 learningRate: 5e-3 ;logreg; // We try to predict the test set.const finalResults = logreg; // Now, you can compare finalResults with the Ytest, which is what you wanted to have.