{{ message }}

# PierpaoloLucarelli / Linear-regression

A linear regression algorithm without gradient descent, visualised in the browser

## Files

Failed to load latest commit information.
Type
Name
Commit time

# Linear-regression

A visualisation of linear regression using a statistical approach.

How to calculate linear regression

We want to find the line that best fits the data. We know that a line is given by y = a + bx So we want to find the values a and b that give the regression line.

This is how we can calculate this values.

Lets start with b (the slope) -> we can calculate this value using the formula b = r * (sY / sX) Where r = Pearson's correlation coefficient, sY = Y standard deviation, sX = X standard deviation

Once we have the slope we can calculate a (y intercept) using the formula -> a = meanY - b * meanX This gives us the slope and y-intercept of the regression line. We can now plot the line and see that it fits the data.

A linear regression algorithm without gradient descent, visualised in the browser

## Releases

No releases published

## Packages 0

No packages published