What is Linear Regression?

Linear Regression is a supervised learning algorithm used to predict a continuous value by finding a linear relationship between input and output variables.

In simple words:

Linear regression draws a straight line that best represents the relationship between variables.

Sometimes, one factor is enough to make a prediction.
But in real life, things are rarely that simple.

Let’s Think Practically 

  • Do marks depend only on study hours?
    No, attendance and practice also matter.
  • Does salary depend only on experience?
    No, skills and education matter too.
  • Does house price depend only on area?
    Definitely not — location and facilities matter.

So, depending on how many input variables are involved, linear regression takes different forms.

Based on the number of independent variables, linear regression is broadly classified into:

2. Types of Linear Regression

2.1 Simple Linear Regression

  • Uses one independent variable
  • Uses one dependent variable

2.2 Multiple Linear Regression

  • Uses two or more independent variables
  • Uses one dependent variable