Options
All
  • Public
  • Public/Protected
  • All
Menu

Model for performing multivariate polynomial regression.

Train the model by *fit()*ing it on data available for training. Afterwards *predict()*ion is possible.

The model is implemented as a pipe consisting of two steps. First the input is transformed by the class PolynomialFeatures, this reduces the problem to a linear regression problem. Hence in the second step we simply apply linear regression.

Hierarchy

  • PolynomialRegressor

Index

Constructors

  • new PolynomialRegressor(degree?: number, homogeneous?: boolean, interactionOnly?: boolean): PolynomialRegressor
  • Basic configuration. You can skip configuration by providing no arguments.

    In case no arguments are given you have to use the method fromConfig(...) to set up a configuration in order to use the method fit(...).

    For the exact meaning of the arguments see the documentation of PolynomialFeatures.

    Parameters

    • Optional degree: number

      Highest order of the monomials

    • homogeneous: boolean = false

      Whether to include only highest order monomials

    • interactionOnly: boolean = false

      Whether to disallow higher powers of single features

    Returns PolynomialRegressor

Properties

_polyFeatures: PolynomialFeatures
_weights: number[][]

Accessors

  • get config(): PolynomialRegressorConfig
  • Saves configuration to a simple option-bag

    The configuration specifies the internal state of a PolynomialRegressor completely. Hence the config of a fitted model can be used to save the model to a file.

    Returns PolynomialRegressorConfig

  • get nFeaturesIn(): number
  • get nFeaturesOut(): number
  • get weights(): number[][]

Methods

  • fit(x: number[][], y: number[][]): void
  • Trains the model.

    Parameters

    • x: number[][]

      List of input vectors.

    • y: number[][]

      List of corresponding desired output vectors.

    Returns void

  • fromConfig(config: PolynomialRegressorConfig): void
  • Loads configuration from simple option-bag.

    Parameters

    • config: PolynomialRegressorConfig

      The configuration to load from.

    Returns void

  • predict(x: number[][]): number[][]
  • predictPoly(xpoly: number[]): number[]

Generated using TypeDoc