Lesson 7.1: Linear Regression
🔹 What is Linear Regression?
Linear Regression is a supervised learning algorithm used to predict a continuous target variable based on one or more input features.
-
It assumes a linear relationship between the input(s) (X) and output (Y).
Equation:
Y=b0+b1XY = b_0 + b_1X
-
YY → Predicted output
-
b0b_0 → Intercept
-
b1b_1 → Slope (effect of X on Y)
🔹 Key Concepts
-
Dependent Variable (Y): The variable we want to predict.
-
Independent Variable (X): Feature(s) used for prediction.
-
Line of Best Fit: Minimizes the sum of squared differences between predicted and actual values.
🔹 Example
Predicting house price based on house size:
-
X_train→ House sizes in training data -
y_train→ Corresponding prices -
y_pred→ Predicted prices for test data
🔹 When to Use
-
Predicting continuous numerical outcomes.
-
Relationship between variables is approximately linear.
✅ Quick Recap:
-
Linear Regression → Predict continuous output using linear relationship.
-
Key parts → Intercept, slope, and line of best fit.
