Lesson · ⏱ 7 min read

🧠 How machines learn: features, labels and training

EnglishHinglish

🏠 Real-life example

An experienced sabziwala can guess a mango's sweetness by its colour, smell and softness. Nobody taught them a formula. They learned from thousands of mangoes and customer feedback. In ML, colour, smell and softness are 'features', 'sweet or not' is the 'label', and those thousands of mangoes are the 'training data'.

💡 In simple words

In supervised learning, the most common kind, you give the model examples with inputs (features) and the correct answer (label). Training means the model adjusts itself to make its guesses match the labels as closely as possible. After training, it predicts labels for new examples it has never seen. In unsupervised learning there are no labels, and the model finds structure on its own, for example grouping similar customers (clustering). The quality and quantity of examples matter more than a fancy algorithm.

🎬 See how it works

Examples (training data)🥭 yellow, soft → sweet🥭 green, hard → not sweet… thousands more⚙️TrainingModellearned patternsNew: 🥭 yellow, softSweet ✓0.92

Labelled examples go into training, which produces a model. The model then predicts the label for a new example it has never seen.

🪜 Step by step

  1. Define what to predict (the label): will this customer cancel next month, yes or no?
  2. Choose the inputs (features) a person would look at: months as a customer, complaints, usage trend, plan price.
  3. Collect past examples where you know both the features and the real outcome.
  4. Train: the algorithm adjusts its internal numbers until its guesses on these examples are as close as possible to the real answers.
  5. Test on examples it has never seen. Only that score tells you how it will do in real life.

🔑 Key terms

Feature
An input the model looks at, e.g. area of a flat.
Label
The correct answer you want predicted, e.g. its price.
Supervised vs unsupervised
Learning with answers vs finding patterns without answers.

👀 See it in action

text
Features (inputs)                       Label (answer)
area=650 sqft, bhk=1, locality=Wakad  → ₹48 lakh
area=1100 sqft, bhk=2, locality=Baner → ₹1.1 crore
... 5,000 more flats ...
New flat: area=900, bhk=2, locality=Wakad → model predicts ≈ ₹70 lakh

The model learns how features relate to price, then applies that to a new flat.

⚠️ Common mistakes to avoid

  • Using features you won't have at prediction time, like 'refund issued' when predicting cancellation.
  • Too few or unrepresentative examples. A model trained only on metro customers may fail for small towns.

✅ Quick check

Grouping customers into similar segments without any predefined groups is…

  1. Supervised learning
  2. Unsupervised learning
  3. Not machine learning
Show answer

B. Unsupervised learning: There are no labels. The model finds the groups itself, which is unsupervised learning (clustering).

🙋 Questions learners ask

How much data do I need?

It depends on the problem. Simple tabular problems can work with a few thousand rows; images or text usually need more, unless you start from a pretrained model.

What does the model actually 'learn'?

Numbers called parameters or weights. Training sets them so that the features map to the right answers as often as possible.

📌 Remember

Features in → label out. Training = learning from examples with known answers.

📖 Words from this lesson (AI dictionary)

Learn this as part of a full course

Track your progress, take the quick checks and follow the lessons in the right order. This lesson is part of:

AI Foundations Path · ML Engineer · Data Engineer (AI focus) · MLOps / AI Platform Engineer · AI Product Manager

Continue in the course