Regression
What is Regression?
Regression is a statistical method used to examine the relationship between a dependent variable and one or more independent variables.
-
It helps us understand how the typical value of the dependent variable changes when any one of the independent variables is varied.
-
It is often used for prediction and forecasting.
๐ข Types of Regression
Type | Description |
---|---|
Linear Regression | Models a straight-line relationship |
Multiple Linear Regression | Uses more than one independent variable |
Polynomial Regression | Fits a curve instead of a straight line |
Logistic Regression | Used when the dependent variable is categorical |
Ridge/Lasso Regression | Used when multicollinearity exists |
๐ 1. Simple Linear Regression
๐ Goal:
Predict a continuous dependent variable using one independent variable.
๐ข Equation:
Where:
-
= dependent variable (output)
-
= independent variable (input)
-
= intercept (value of when )
-
= slope (change in for a one-unit change in )
Example: Predict Student Marks from Study Hours
Hours Studied (x) | Marks Obtained (y) |
---|---|
2 | 50 |
4 | 60 |
6 | 65 |
8 | 70 |
10 | 85 |
✅ Regression Output (e.g., via Excel or Python):
After applying regression, you might get:
So, if a student studies 7 hours:
๐ฏ Prediction: The student will score 73 marks.
๐ 2. Multiple Linear Regression
Used when more than one independent variable is used to predict a dependent variable.
๐ข Equation:
Example:
Predicting house price using:
-
: size of house (sq ft)
-
: number of bedrooms
๐ 3.Logistic Regression (for classification)
Used when the output is categorical, like Yes/No, 0/1, True/False.
Example:
Predict whether a student passes (1) or fails (0) based on study hours.
Output: Probability → if above 0.5, we classify as "pass".
Comments
Post a Comment