Example Of Univariate Linear Regression
For line Y = 2X + 3; the Input feature will be X and Y will be the target.
X | Y |
---|---|
1 | 5 |
2 | 7 |
3 | 9 |
4 | 11 |
5 | 13 |
Concept: For univariate linear regression, there is only one input feature vector. The line of regression will be in the form of the following:
Y = b0 + b1 * X Where, b0 and b1 are the coefficients of regression.
here we try to find the best b0 and b1 by training a model so that our predicted variable y has minimum difference with actual y.
A univariate linear regression model constitutes of several utility functions. We will define each function one by one and at the end, we will combine them in a class to form a working univariate linear regression model object.
Univariate Linear Regression in Python
In this article, we will explain univariate linear regression. It is one of the simplest types of regression. In this regression, we predict our target value on only one independent variable.