https://github.com/kevin-kip/py-linear-regression
A basic implementation of linear regression in python 3.6
https://github.com/kevin-kip/py-linear-regression
algorithms linear-regression machine-learning python python3-6
Last synced: about 1 year ago
JSON representation
A basic implementation of linear regression in python 3.6
- Host: GitHub
- URL: https://github.com/kevin-kip/py-linear-regression
- Owner: Kevin-Kip
- Created: 2018-08-18T12:12:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-01T16:54:20.000Z (almost 8 years ago)
- Last Synced: 2025-01-23T21:18:06.409Z (over 1 year ago)
- Topics: algorithms, linear-regression, machine-learning, python, python3-6
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Linear Regression (in Python)
This is a basic implementation of Linear Regression.
The basic formula is `y = mx + b`, where:
1. y is the output,
2. m is the slope of the line,
3. x is the input and
4. b is the y-intercept.
## Easy, Right?
Yes, Linear Regression is the most basic of all.
## Solving mysteries
Since `x` is what the user inputs, and `y` is what the algorithm spits out, "what is m and b" you may ask?
Well:
`m = sum of (eachX - meanOfX)*(eachY - sumOfY) / sum of(square of (eachX - meanOfX))`
`b = meanOfY - (m * meanOfX)`
## You wanna try code?
1. CLone download the repo
2. navigate to the root directory
3. run in terminal `python main.py`
You will be prompted to input a number and you will receive a prediction(float).