ml.js

Machine learning tools in JavaScript

README

ml.js - Machine learning tools in JavaScript


Introduction


This library is a compilation of the tools developed in the mljs organization.
It is mainly maintained for use in the browser. If you are working with Node.js, you might prefer to add
to your dependencies only the libraries that you need, as they are usually published to npm more often.  
We prefix all our npm package names with ml- (eg. ml-matrix) so they are easy to find.

To include the ml.js library in a web page:

  1. ``` html
  2. <script src="https://www.lactame.com/lib/ml/6.0.0/ml.min.js"></script>
  3. ```

It will be available as the global ML variable. The package is in UMD format.

List of included libraries


Unsupervised learning


- Principal component analysis (PCA): [ML.PCA](https://github.com/mljs/pca)
- Hierarchical clustering: [ML.HClust](https://github.com/mljs/hclust)
- K-means clustering: [ML.KMeans](https://github.com/mljs/kmeans)

Supervised learning


- Naive Bayes: [ML.NaiveBayes](https://github.com/mljs/naive-bayes)
- K-Nearest Neighbor (KNN): [ML.KNN](https://github.com/mljs/knn)
- Partial least squares (PLS): [ML.PLS](https://github.com/mljs/pls)
- K-OPLS: [ML.KOPLS](https://github.com/mljs/pls)
- Cross-validation: [ML.CrossValidation](https://github.com/mljs/cross-validation)
- Confusion matrix: [ML.ConfusionMatrix](https://github.com/mljs/confusion-matrix)
- Decision tree classifier: [ML.DecisionTreeClassifier](https://github.com/mljs/decision-tree-cart)
- Random forest classifier: [ML.RandomForestClassifier](https://github.com/mljs/random-forest)

Artificial neural networks (ANN)


- Feedforward Neural Networks: [ML.FNN](https://github.com/mljs/feedforward-neural-networks)
- Self-organizing map / Kohonen networks: [ML.SOM](https://github.com/mljs/som)

Regression


- Simple linear regression: [ML.SimpleLinearRegression](https://github.com/mljs/regression-simple-linear)
- Polynomial regression: [ML.PolynomialRegression](https://github.com/mljs/regression-polynomial)
- Multivariate linear regression: [ML.MultivariateLinearRegression](https://github.com/mljs/regression-multivariate-linear)
- Power regression: [ML.PowerRegression](https://github.com/mljs/regression-power)
- Exponential regression: [ML.ExponentialRegression](https://github.com/mljs/regression-exponential)
- Theil-Sen regression: [ML.TheilSenRegression](https://github.com/mljs/regression-theil-sen)
- Robust polynomial regression: [ML.RobustPolynomialRegression](https://github.com/mljs/regression-robust-polynomial)
- Decision tree regression: [ML.DecisionTreeRegression](https://github.com/mljs/decision-tree-cart)
- Random forest regression: [ML.RandomForestRegression](https://github.com/mljs/random-forest)

Optimization


- Levenberg-Marquardt: [ML.levenbergMarquardt](https://github.com/mljs/levenberg-marquardt)
- Fast Combinatorial Non-negative Least Squares: [ML.FCNNLS](https://github.com/mljs/fcnnls)

Math


- Matrix: [ML.Matrix](https://github.com/mljs/matrix) (Matrix class)
- Singular value decomposition (SVD): [ML.SVD](https://github.com/mljs/matrix)
- Eigenvalue decomposition (EVD): [ML.EVD](https://github.com/mljs/matrix)
- Cholesky decomposition: [ML.CholeskyDecomposition](https://github.com/mljs/matrix)
- Lu decomposition: [ML.LuDecomposition](https://github.com/mljs/matrix)
- Qr decomposition: [ML.QrDecomposition](https://github.com/mljs/matrix)
- Sparse matrix: [ML.SparseMatrix](https://github.com/mljs/sparse-matrix)
- Kernels: [ML.Kernel](https://github.com/mljs/kernel)
- Distance functions: [ML.Distance](https://github.com/mljs/distance)
- Similarity functions: [ML.Similarity](https://github.com/mljs/distance)
- Distance matrix: [ML.distanceMatrix](https://github.com/mljs/distance-matrix)
- XORShift-add RNG: [ML.XSadd](https://github.com/mljs/xsadd)
- non-negative Generalized Morphological Component Analysis [ML.nGMCA](https://github.com/mljs/nGMCA)

[ML.Array](https://github.com/mljs/array)


- [ML.Array.min](https://github.com/mljs/array/tree/master/packages/array-min)
- [ML.Array.max](https://github.com/mljs/array/tree/master/packages/array-max)
- [ML.Array.median](https://github.com/mljs/array/tree/master/packages/array-median)
- [ML.Array.mean](https://github.com/mljs/array/tree/master/packages/array-mean)
- [ML.Array.mode](https://github.com/mljs/array/tree/master/packages/array-mode)
- [ML.Array.normed](https://github.com/mljs/array/tree/master/packages/array-normed)
- [ML.Array.rescale](https://github.com/mljs/array/tree/master/packages/array-rescale)
- [ML.Array.sequentialFill](https://github.com/mljs/array/tree/master/packages/array-sequential-fill)
- [ML.Array.standardDeviation](https://github.com/mljs/array/tree/master/packages/array-standard-deviation)
- [ML.Array.variance](https://github.com/mljs/array/tree/master/packages/array-variance)

[ML.ArrayXY](https://github.com/mljs/array-xy)


Functions dealing with an object containing 2 properties x and y, both arrays.

Example:

  1. ``` js
  2. let result = ML.ArrayXY.sortX({ x: [2, 3, 1], y: [4, 6, 2] });
  3. // result = {x: [1,2,3], y: [2,4,6]}
  4. ```

- ML.ArrayXY.weightedMerge: Merge abscissa values on similar ordinates and weight the group of abscissa

- ML.ArrayXY.maxMerge: Merge abscissa values on similar ordinates and keeps the abscissa with bigger ordinate value
- ML.ArrayXY.closestX: Get the closest point for a specific abscissa value
- ML.ArrayXY.centroidsMerge: Merge abscissa values if the ordinate value is in a list of centroids
- ML.ArrayXY.sortX: Sort a set of point based on the abscissas values
- ML.ArrayXY.maxY: Sort a set of point based on the abscissas values
- ML.ArrayXY.uniqueX: Ensure that x values are unique

Statistics


- Performance (ROC curve): [ML.Performance](https://github.com/mljs/performance)

Data processing


- Principal component analysis (PCA): [ML.PCA](https://github.com/mljs/pca)
- Savitzky-Golay filter: [ML.savitzkyGolay](https://github.com/mljs/savitzky-golay)
- Global Spectral Deconvolution (GSD): [ML.GSD](https://github.com/mljs/global-spectral-deconvolution)

Utility


- Bit array operations: [ML.BitArray](https://github.com/mljs/bit-array)
- Hash table: [ML.HashTable](https://github.com/mljs/hash-table)
- Pad array: [ML.padArray](https://github.com/mljs/pad-array)
- Binary search: [ML.binarySearch](https://github.com/darkskyapp/binary-search)
- Number comparison functions for sorting: [ML.numSort](https://github.com/sindresorhus/num-sort)
- Random number generation: [ML.Random](https://github.com/mljs/random)

License