All popular Machine Learning algorithms are made available in this repository.
Node.js, matrix_deep_clone, jsnumpy.
$ npm install jsmachinelearning
Multiple Linear Regression.
> var MLAlgorithms = ;> var model = ;> x =1 24 26 32 35 1> y=12325;> model;> var k = model> console;02285865948088468 18311543879819048
MultipleLinearRegression function provides a model using which we can train on data with more then one feature vector. In the above example we are having two feature vector in X. It can also be used to predict the value for the unknown data.
Simple Linear Regression
> var model = ;> x = 23456;> y = 12325;> model> k = model;> console;1 26 34 ;
SimpleLinearRegression provides a model for training on data with single feature vector. It can also predict value for unknown sample.
Train test split
> var data =1 43 23 32 45 13 67 44 8> var train test = mlAlgorithms;> console;1 43 23 32 4> console;7 44 85 13 6
train_test_split function divides the data in the train_ratio mentioned. The default value for train_ratio is 0.75 i.e. 75 percent of the data becomes training and 25 percent data becomes test data. The data is not selected in sequential order but instead it is randomized so that proper predication can be made based on the data.
Separate feature and target data
> var data =1 43 23 32 45 13 67 44 8> var x y = mlAlgorithms;> console;1 433 325 137 44> console;2 4 6 8
get_X_And_Y function returns feature vector and target variable Separated. The function assumes the last column of the data has target variable and first n-1 column has feature vector.
- Nikhil Ashodariya -(https://github.com/NikhilAshodariya)
This project is licensed under the MIT License