Machine Learning Tutorial - Linear Regression
๐ Linear Regression - Simple Prediction
๐ Real Life Example:
๐ Study vs Marks:
1 hour study โ 50 marks
2 hours โ 60 marks
3 hours โ 70 marks
Pattern: Seedhi line! (Linear)
Prediction: 4 hours โ 80 marks (approx)
๐ฏ Use Cases
| Problem | Prediction |
|---|---|
| House Size | Price |
| Experience | Salary |
| Temperature | Ice Cream Sales |
| Ad Spend | Revenue |
๐ Formula
y = mx + c
y = Prediction
m = Slope (kitna badhega)
x = Input
c = Starting point
Example
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X, y)