Home Reference Source
import {MultipleLinearRegression} from '@tensorscript/ts-mlr/lib/mlr.mjs'
public class | source

MultipleLinearRegression

Extends:

@tensorscript/core~TensorScriptModelInterface → MultipleLinearRegression

Implements:

  • TensorScriptModelInterface

Mulitple Linear Regression with Tensorflow

Constructor Summary

Public Constructor
public

constructor(options: Object, properties: *)

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

calculate(matrix: Array<Array<number>>|Array<number>): {data: Promise}

Predicts new dependent variables

public

async train(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>): Object

Asynchronously trains tensorflow model

Public Constructors

public constructor(options: Object, properties: *) source

Params:

NameTypeAttributeDescription
options Object

tensorflow model hyperparameters

properties *

extra instance properties

Public Members

public model source

public xShape source

public yShape source

Public Methods

public calculate(matrix: Array<Array<number>>|Array<number>): {data: Promise} source

Predicts new dependent variables

Params:

NameTypeAttributeDescription
matrix Array<Array<number>>|Array<number>

new test independent variables

Return:

{data: Promise}

returns tensorflow prediction

public async train(x_matrix: Array<Array<number>>, y_matrix: Array<Array<number>>): Object source

Asynchronously trains tensorflow model

Params:

NameTypeAttributeDescription
x_matrix Array<Array<number>>

independent variables

y_matrix Array<Array<number>>

dependent variables

Return:

Object

returns trained tensorflow model