Back to godoc.org

Package ml

v0.0.0-...-3d60970
Latest Go to latest

The latest major version is .

Published: Aug 5, 2020 | License: MIT | Module: git.sr.ht/~flobar/apoco

Index

Constants

const (
	False = float64(0)
	True  = float64(1)
)

Predefined values for true and false.

func Bool

func Bool(t bool) float64

Bool converts a bool to a value representing false or true.

func Normalize

func Normalize(xs *mat.Dense) error

Normalize normalizes the the given feature vectors.

type LR

type LR struct {
	LearningRate float64
	Ntrain       int
	// contains filtered or unexported fields
}

LR implements LinearRegression

func (*LR) Fit

func (lr *LR) Fit(x *mat.Dense, y *mat.VecDense)

Fit fits the linear regression model.

func (*LR) MarshalJSON

func (lr *LR) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshal interface.

func (*LR) Predict

func (lr *LR) Predict(x *mat.Dense, t float64) *mat.VecDense

Predict calculates the predictions for the given values.

func (*LR) PredictProb

func (lr *LR) PredictProb(x *mat.Dense) *mat.VecDense

PredictProb calculates the probablility predictions for the given values.

func (*LR) UnmarshalJSON

func (lr *LR) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshal interface.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier