Machine Learning may sound complex 🤖, but it actually starts with something very simple:
👉 Finding relationships in data
y = ax + b
🎯 Problem Scenario
We want to understand the relationship between:
- H (Hours Studied) → Input
- M (Marks Obtained) → Output
📋 Step 1: Collecting Data
| Hours Studied (H) | Marks (M) |
|---|---|
| 1 | 10 |
| 2 | 19 |
| 3 | 28 |
| 4 | 37 |
| 5 | 46 |
📌 This is called a dataset in Machine Learning.
📈 Step 2: Graph Representation
We plot the data on a graph:
- X-axis → Hours Studied
- Y-axis → Marks
Marks (M)
|
50| *
45| *
40| *
35| *
30| *
25|
20|
15|
10| *
|________________________________
1 2 3 4 5 Hours (H)
✨ Observation: Points form a straight line → Linear relationship
🧠 Step 3: Choosing the Model
M = aH + b
- a → slope 📈
- b → intercept
🧮 Step 4: Finding the Equation (Mathematical Method)
Now we calculate values of a and b using data.
Take two points:
- (1, 10)
- (2, 19)
✏️ Form Equations
From M = aH + b:
10 = a + b (Eq. 1)
19 = 2a + b (Eq. 2)
🔍 Solve the Equations
Subtract Eq.1 from Eq.2:
(2a + b) − (a + b) = 19 − 10
a = 9
Now substitute in Eq.1:
10 = 9 + b
b = 1
✅ Final Model
M = 9H + 1
📊 Step 5: Understanding the Model
- ✅ Every extra hour → +9 marks
- ✅ At 0 hours → 1 mark
🔮 Step 6: Prediction
For H = 6:
M = 9 × 6 + 1 = 55
🎉 Predicted Marks = 55
🤖 Machine Learning Connection
| Step | ML Concept |
|---|---|
| Data | Dataset |
| Graph | Visualization |
| Equation | Model |
| Prediction | Output |
🚀 Conclusion
Machine Learning is simply:
- ✔ Data
- ✔ Math
- ✔ Logic
And it all starts with a simple equation:
y = ax + b
📝 Try Yourself
- Predict marks for 7 hours
- Predict marks for 8 hours
- What if H = 0?
🚀 Next Blog in Series
💻 Machine Learning with Polynomials: Implementing in Python
Now that you understand how we derived the equation M = 9H + 1, take the next step and learn how to implement this logic using Python. Build your first Machine Learning model and make predictions with code!
👉 Read Next Blog