Package Exports
- ml-pls
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ml-pls) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Partial Least Squares (PLS)
PLS regression algorithm based on the Yi Cao Matlab implementation:
Partial Least-Squares and Discriminant Analysis
installation
$ npm install ml-pls
Methods
new PLS(X, Y)
pls.train(options)
Example
var X = [[0.1, 0.02], [0.25, 1.01] ,[0.95, 0.01], [1.01, 0.96]];
var Y = [[1, 0], [1, 0], [1, 0], [0, 1]];
var options = {
latentVectors: 10,
tolerance: 1e-4
};
var pls = new PLS(X, Y);
pls.train(options);
predict(dataset)
Predict the values of the dataset.
Arguments
dataset
- A matrix that contains the dataset.
Example
var dataset = [[0, 0], [0, 1], [1, 0], [1, 1]];
var ans = pls.predict(dataset);
getExplainedVariance()
Returns the explained variance on training