Linear Regression is one of the most fundamental algorithms in Machine Learning. It is a type of supervised learning used to predict a continuous numerical value based on one or more input features.
Establishes a linear relationship between dependent variable (Y) and independent variable(s) (X).
Represented by the equation: Y=mX+c
Where: Y = predicted output
X = input feature
m = slope of the line
= intercept
For multiple features, it becomes Multiple Linear Regression
Y=b0+b1X1+b2X2+...+bnXn
Simple Linear Regression – One independent variable
Multiple Linear Regression – Two or more independent variables
Collect and preprocess data
Identify input features (X) and target variable (Y)
Fit a line that minimizes the difference between predicted and actual values (using Least Squares Method)
Evaluate the model using metrics like Mean Squared Error (MSE), R² score
Predicting house prices
Stock market forecasting
Sales and revenue prediction
Weather prediction
Simple to implement and interpret
Works well with linearly correlated data
Cannot model non-linear relationships
Sensitive to outliers
Take quizzes related to this topic and see where you stand!
Start Quiz Now