Skip to content

Latest commit

 

History

History
125 lines (57 loc) · 1.99 KB

File metadata and controls

125 lines (57 loc) · 1.99 KB

Home > @josh-brown/vector > LinearRegressor

LinearRegressor class

A Regressor model which uses an ordinary least squares model with regularization to predict a continuous target. The optimal set of parameters is computed with gradient descent.

Signature:

export declare class LinearRegressor implements Regressor<LinearRegressorHyperparams> 

Implements: Regressor<LinearRegressorHyperparams>

Constructors

Constructor

Modifiers

Description

(constructor)(hyperParameters)

Constructs a new instance of the LinearRegressor class

Methods

Method

Modifiers

Description

getHyperParameters()

Return the full set of hyperparameters used to train the model, including defaults.

getParameters()

Get the coefficients of the trained linear regression model, or undefined if the model has not been trained.

predict(data)

Uses the learned parameters to make predictions based on a set of input data.

train(data, target)

Learns the optimal set of parameters for the model.