Creates a new OPLS model from features and labels.
matrix containing data (X).
1D Array containing metadata (Y). Numeric labels trigger regression, string labels trigger discriminant analysis.
Optionaloptions: {constructor options.
Optionalcenter?: booleanshould the data be centered (subtract the mean).
OptionalcvFolds?: any[]Allows to provide folds as array of objects with the arrays trainIndex and testIndex as properties.
OptionalmaxComponents?: numberupper bound on the number of orthogonal components. The fit normally stops earlier (when adding a component no longer improves the cross-validated metric by at least 0.05); this is a hard cap that guarantees termination even when the metric never plateaus.
OptionalnbFolds?: numberAllows to generate the defined number of folds with the training and test set chosen randomly from the data set.
Optionalscale?: booleanshould the data be scaled (divide by the standard deviation).
get access to all the computed elements Mainly for debug and testing
output object
Returns the cross-validated predictive and orthogonal scores.
the predictive (scoresX) and orthogonal (scoresY) cross-validated scores.
Predict scores for new data
a matrix containing new data
Optionaloptions: { center?: boolean; scale?: boolean; trueLabels?: any[] } = {}prediction options.
Optionalcenter?: booleanshould the data be centered before prediction.
Optionalscale?: booleanshould the data be scaled before prediction.
OptionaltrueLabels?: any[]an array with true values to compute confusion matrix.
Predicts the class of each row of new data (discriminant analysis mode).
a matrix containing new data.
Optionaloptions: { center?: boolean; scale?: boolean; trueLabels?: any[] } = {}prediction options.
Optionalcenter?: booleanshould the data be centered before prediction.
Optionalscale?: booleanshould the data be scaled before prediction.
OptionaltrueLabels?: any[]an array with true values to compute confusion matrix.
the predicted class name for each row of features.
Export the current model to a JSON object
model
StaticloadLoad an OPLS model from JSON
the serialized model to load.
the loaded OPLS model.
OPLS (orthogonal projections to latent structures).