🟪 1-Minute Summary
Linear regression models the relationship between independent variables (X) and a continuous dependent variable (y) using a straight line: y = β₀ + β₁x₁ + … + βₙxₙ. Finds coefficients that minimize error (typically using least squares). Assumptions: linearity, independence, homoscedasticity, normality of residuals. Evaluate with R², RMSE, MAE. Simple but powerful baseline model.
🟦 Core Notes (Must-Know)
What is Linear Regression?
[Content to be filled in]
The Equation
[Content to be filled in]
How It Works (Least Squares)
[Content to be filled in]
Key Assumptions
[Content to be filled in]
- Linearity
- Independence
- Homoscedasticity
- Normality of residuals
- No multicollinearity
When to Use
[Content to be filled in]
Interpreting Coefficients
[Content to be filled in]
🟨 Interview Triggers (What Interviewers Actually Test)
Common Interview Questions
-
“Explain linear regression to a non-technical person”
- [Answer: Drawing best-fit line through data points]
-
“What are the assumptions of linear regression?”
- [Answer: List 5 assumptions above]
-
“How do you check if assumptions are violated?”
- [Answer framework: Residual plots, VIF for multicollinearity]
-
“What does a negative coefficient mean?”
- [Answer: Inverse relationship]
🟥 Common Mistakes (Traps to Avoid)
Mistake 1: Using linear regression for non-linear relationships
[Content to be filled in]
Mistake 2: Not checking assumptions
[Content to be filled in]
Mistake 3: Ignoring multicollinearity
[Content to be filled in]
🟩 Mini Example (Quick Application)
Scenario
[Predicting house prices based on square footage]
Solution
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, r2_score
# Example to be filled in
🔗 Related Topics
Navigation: