linreg

package
v0.0.0-...-cba17b0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Overview

Package linreg provides a basic implementation of linear regression with gradient descent on two dimensional data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gradient

func Gradient(xs, ys []float64, m, c float64) (cost, dm, dc float64)

Gradient computes the cost function and its gradients.

func LinearRegression

func LinearRegression(xs, ys []float64, iterations int, alpha float64) (m, c float64)

LinearRegression runs the requested number of iterations of gradient descent and returns the latest approximated coefficients.

Types

This section is empty.

Jump to

Keyboard shortcuts

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