utils

package
v0.0.0-...-c48d809 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustWeight

func AdjustWeight(p Parameters) ([]float64, float64)

func Cosine

func Cosine(a []float64, b []float64) float64

func Counter

func Counter(v []int) map[int]int

func EuclideanDistance

func EuclideanDistance(v1 []float64, v2 []float64) float64

func GeneratePoints

func GeneratePoints(x []float64, y []float64) plotter.XYs

func GetRowData

func GetRowData(x mat.Matrix, idx int) []float64

func GetRowMatrix

func GetRowMatrix(x mat.Matrix, idx int) mat.Matrix

func Predict

func Predict(w []float64, M mat.Matrix, b float64) []float64

func R2

func R2(y_hat []float64, y []float64) float64

func RandomizeDataset

func RandomizeDataset(X, y mat.Matrix) (mat.Matrix, mat.Matrix)

func SplitDataset

func SplitDataset(X mat.Matrix, y mat.Matrix, percent float64) (mat.Matrix, mat.Matrix, mat.Matrix, mat.Matrix)

func Sum

func Sum(v []float64) float64

func SumAbs

func SumAbs(v []float64) float64

func Unique

func Unique(v []int) []int

func UpdateWeightsHuber

func UpdateWeightsHuber(x mat.Matrix, y mat.Matrix, y_hat mat.Matrix, delta float64) ([]float64, float64)

func UpdateWeightsMAE

func UpdateWeightsMAE(x mat.Matrix, y mat.Matrix, y_hat mat.Matrix) ([]float64, float64)

func UpdateWeightsMSE

func UpdateWeightsMSE(x mat.Matrix, y mat.Matrix, y_hat mat.Matrix) ([]float64, float64)

Types

type Parameters

type Parameters struct {
	X mat.Matrix
	// contains filtered or unexported fields
}

func NewParameters

func NewParameters(X mat.Matrix, y mat.Matrix, w []float64, b float64, epochs int, losses []float64, lr float64, funcType string, isStochastic bool, delta float64) Parameters

type TypeFactoration

type TypeFactoration string
const (
	SVD TypeFactoration = "SVD"
	QR                  = "QR"
)

Jump to

Keyboard shortcuts

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