linreg

package
v0.0.0-...-693ff27 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeCost

func ComputeCost(X, y, theta *mat.Dense) float64

ComputeCost computes the cost of using theta as the parameter for linear regression to fit the data points in X and y.

func GradientDescent

func GradientDescent(X, y, theta *mat.Dense, alpha float64, iters int) (*mat.Dense, [][]float64, []float64)

GradientDescent performs gradient descent to learn theta returns the updated theta after taking iters gradient steps with learning rate alpha.

func InitParameters

func InitParameters(data mat.Matrix) (X, y, theta *mat.Dense)

InitParameters returns the X, y and theta parameters extracted from the given data matrix. It uses the last column for y, the rest for X, and zeros for theta.

func NormalizeFeatures

func NormalizeFeatures(X *mat.Dense) (means, stdDevs *mat.Dense)

NormalizeFeatures normalizes the given matrix of features and returns the matrix of means and standard deviations.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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