Building in PublicRead Blog
What is Machine Learning ?

What is Machine Learning ?

D
Dev.Log
4 min read
5 views
Share:

What is Machine Learning?

A no-fluff guide. You'll learn what ML actually is, how it learns, and where it shows up — with real examples, not buzzwords.

The one-sentence definition

Machine Learning is a way to build software that learns patterns from data instead of relying on hand-written rules.

Traditional programming vs. ML

Traditional CodeMachine Learning
ApproachYou write rules → the computer follows themYou provide examples → the computer finds the rules
Exampleif spam_words > 5: rejectmodel.fit(emails, labels)

Why does this matter?

Some problems are too complex to solve with rules. Imagine trying to write an if-else rule to decide whether a photo contains a cat. You would have to describe fur texture, ear shape, whisker length — for every breed, angle, and lighting condition. It is not practical.

ML solves this by showing the system 1 million cat photos and letting it learn what "cat" looks like on its own.

How does a machine actually "learn"?

Three steps, always:

  1. Feed it data with answers Example: 10,000 house sales — size, location, price paid.
  2. Model makes predictions, checks errors It guesses ₹50L for a house. The actual price was ₹80L. Error = ₹30L.
  3. Adjust and repeat It tweaks internal weights. It does this thousands of times until errors get small.

That's it. No magic. Just trial → error → correction, at scale.

The 3 types of ML

1. Supervised Learning ⭐ Most common

You provide labeled examples (input + correct answer). The model learns to map inputs → outputs.

📧 Example: Email spam detection — emails labeled "spam" or "not spam" train the model.

2. Unsupervised Learning

No labels. The model finds hidden structure in raw data on its own.

🛒 Example: Amazon grouping customers into segments (deal-hunters, premium buyers) without being told what the groups are.

3. Reinforcement Learning

An agent takes actions in an environment. It gets rewards for good moves and penalties for bad ones. It learns through trial and error.

🎮 Example: AlphaGo — never told the rules of winning; learned by playing millions of games against itself.

A concrete example: predicting house prices

You want to predict: given a house's size and location, what will it sell for?

Size (sq ft)LocationSold for
800Suburbs₹45L
1200City centre₹95L
950Suburbs₹58L
......... 10,000 more rows

The ML model learns: "city centre adds roughly ₹X per sq ft, suburbs less so."

Now give it a new house it has never seen — it predicts a price. No rule was hand-written. The pattern came from the data.

Where ML shows up in real life

ProductWhat it learnedWhat it does
📺 NetflixYour watch historyRecommends what you'll enjoy next
🏦 Bank fraud detectionNormal spending patternsFlags unusual transactions
🎙️ Voice assistantsMillions of voice clipsConverts your speech to text
🩺 Medical diagnosisX-rays + diagnosesSpots pneumonia from scans

What ML is not good at

⚠️ Know the limits before you rely on it.

  • No data = no learning. ML needs large, high-quality datasets. There is no shortcut.
  • Garbage in, garbage out. Biased data produces biased models.
  • It can't reason or explain. A model might get the right answer for the wrong reason.
  • Doesn't generalise beyond training. A model trained only on cats may fail on foxes.

TL;DR

  • ML = finding patterns in data, not writing rules by hand
  • It learns by making predictions, measuring errors, and adjusting
  • 3 flavours: Supervised, Unsupervised, Reinforcement
  • Powers spam filters, recommendations, fraud detection, and more
  • Only as good as the data you feed it

Share this article

Share:
D

About Dev.Log

Passionate about web development and continuous learning. Sharing insights, tutorials, and lessons learned from my journey in software engineering.

Learn more about me