Skip to content

bcgoss/linear_regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linear Regression

This is a code-along project created for the Armstrong Possee at the Turing School. It explores the how to put Linear Regression into practice.

This program will accept a CSV file path for a set of training data, and a pair of initial values for theta0 and theta1. The values of theta determine the hypothesis function, which is in the form h(x) = theta0 + theta1 * x.

The "cost" method calculates the difference between the y-coordinate of the training data and the result of the hypothesis function for a given point.

The "learn" method uses the gradient of the cost function to find new values for theta0 and theta1. The result of the cost function should decrease after each application of the learn method.

Finally, "learn_cycle" manages a loop which executes "learn" until the difference between theta0 and theta1 before and after learn is smaller than some threshold value.

About

Tries to find a line that fits data in a csv.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages