Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeCost ¶
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 ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.