mlregression

package
v0.0.0-...-0c3627a Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeCost

func ComputeCost(data [][]float64, y []float64, theta []float64) (float64, error)

func ComputeHypothesis

func ComputeHypothesis(x []float64, theta []float64) float64

func ComputeHypothesisVectorized

func ComputeHypothesisVectorized(theta mat.Matrix, data mat.Matrix) mat.Matrix

func LinearGradient

func LinearGradient(data [][]float64, y []float64, theta []float64, alpha float64, num_iters int, printCostFunction bool) ([]float64, error)

func Normalize

func Normalize(input [][]float64) ([][]float64, []float64, []float64, error)

Types

type Data

type Data interface {
	Inputs() [][]float64
	Output() []float64
}

type Learner

type Learner interface {
	Learn(src Data, alpha float64, numIter int) (Predictor, error)
}

func NewSliceLearner

func NewSliceLearner() Learner

type Predictor

type Predictor interface {
	PredictOne(ins []float64) float64
}

type SliceLearner

type SliceLearner struct {
}

func (*SliceLearner) Learn

func (l *SliceLearner) Learn(src Data, alpha float64, numIter int) (Predictor, error)

type SlicePredictor

type SlicePredictor struct {
	NumInputs int
	Theta     []float64
	M         []float64
	S         []float64
}

func (*SlicePredictor) PredictOne

func (p *SlicePredictor) PredictOne(ins []float64) float64

Jump to

Keyboard shortcuts

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