ml-pls
    Preparing search index...

    Class PLS

    PLS

    Index

    Constructors

    • Constructor for Partial Least Squares (PLS)

      Parameters

      • options: { latentVectors?: number; scale?: boolean; tolerance?: number }

        constructor options.

        • OptionallatentVectors?: number

          Number of latent vector to get (if the algorithm doesn't find a good model below the tolerance)

        • Optionalscale?: boolean

          rescale dataset using mean.

        • Optionaltolerance?: number

          tolerance used to stop the algorithm.

      • model: object

        for load purposes.

      Returns PLS

    Properties

    B: Matrix | undefined
    E: Matrix | undefined
    F: Matrix | undefined
    latentVectors: number | undefined
    meanX: any
    meanY: any
    P: Matrix | undefined
    PBQ: Matrix | undefined
    Q: Matrix | undefined
    R2X: any
    scale: any
    scaleMethod: any
    ssqYcal: number | undefined
    stdDevX: any
    stdDevY: any
    T: Matrix | undefined
    tolerance: any
    U: Matrix | undefined
    W: Matrix | undefined

    Methods

    • Returns the explained variance on training of the PLS model

      Returns number

      the explained variance.

    • Predicts the behavior of the given dataset.

      Parameters

      • dataset: any[] | Matrix

        data to be predicted.

      Returns Matrix

      • predictions of each element of the dataset.
    • Export the current model to JSON.

      Returns object

      • Current model.
    • Fits the model with the given data and predictions, in this function is calculated the following outputs:

      T - Score matrix of X P - Loading matrix of X U - Score matrix of Y Q - Loading matrix of Y B - Matrix of regression coefficient W - Weight matrix of X

      Parameters

      • trainingSet: any[] | Matrix

        matrix of features.

      • trainingValues: any[] | Matrix

        matrix of predictions.

      Returns void

    • Load a PLS model from a JSON Object

      Parameters

      • model: object

        the serialized model to load.

      Returns PLS

      • PLS object from the given model