This is a basic implementation of Linear Regression.
The basic formula is y = mx + b
, where:
- y is the output,
- m is the slope of the line,
- x is the input and
- b is the y-intercept.
Yes, Linear Regression is the most basic of all.
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)
- CLone download the repo
- navigate to the root directory
- run in terminal
python main.py
You will be prompted to input a number and you will receive a prediction(float).