ml

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Predefined values for true and false.

Variables

This section is empty.

Functions

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.

Types

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) GobDecode added in v0.0.7

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

GobDecode implements the GobDecoder interface.

func (*LR) GobEncode added in v0.0.7

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

GobEncode implements the GobEncoder interface.

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.

func (*LR) Weights added in v0.0.7

func (lr *LR) Weights() []float64

Weights returns the weights of the logic regression model.

Jump to

Keyboard shortcuts

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