ols

package module
v0.0.0-...-0dd20d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger *logrus.Logger)

SetLogger replaces the default logger

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model handles the regression

func NewModel

func NewModel(x, y mat64.Matrix) *Model

NewModel creates a new model with an intercept by default

func NewModelWithIntercept

func NewModelWithIntercept(x, y mat64.Matrix, intercept bool) *Model

NewModelWithIntercept creates a new OLS model with or without an intercept x or y can be nil, just needs to be updated before training

func (*Model) Dims

func (m *Model) Dims() (int, int)

Dims returns number of independent variabes and count of rows

func (*Model) SetX

func (m *Model) SetX(data mat64.Matrix)

SetX replaces the independent variables in the model

func (*Model) SetY

func (m *Model) SetY(y mat64.Matrix)

SetY replaces the dependent model NOTE: only uses first column of the matrix

func (*Model) Train

func (m *Model) Train() *mat64.Dense

Train - process the data and return the result

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL