Univariate Linear Regression

Here, you’ll learn more about Regression and the concepts of Univariate Linear Regression.

Univariate Linear Regression

In Univariate Linear Regression, we have one independent variable xx which we use to predict a dependent variable yy.

We will be using the Tips Dataset from Seaborn’s Datasets to illustrate theoretical concepts.



We will be using the following columns from the dataset for Univariate Analysis.

  • Total_bill: It is the total bill of food served.

  • Tip: It is the tip given on the cost of food.


Goal of Univariate Linear Regression: The goal is to predict the “tip” given on a “total_bill”. The regression model constructs an equation to do so.

If we plot the scatter plot between the independent variable (total_bill) and dependent variable (tip), we will get the plot below.



  • We can see that the points in the scatter plot are mostly scattered along the diagonal.

  • This is an indication that there can be some positive correlation between the total_bill and tip. This will be fruitful in modeling.


Working

The univariate Linear Regression model comes up with the following equation of the straight line.

y^=w0+w1x\hat{y} = w_0 + w_1 * x

Or

tip_predicte ...