What is Machine Learning?

In the previous tutorial, we learned that Artificial Intelligence (AI) is a technology that helps computers perform tasks that normally require human intelligence.

But this gives us an important question:

How can a computer learn to perform these tasks?

This is where Machine Learning (ML) comes in.


📈 What is Machine Learning?

Machine Learning is a way of building AI systems where computers learn patterns from data and use those patterns to make predictions or decisions.

In simple words:

Instead of writing every rule ourselves, we give the computer data and let it learn the patterns from that data.

Let’s understand this with an example.


💡 A Simple Example: Cat or Dog?

Suppose you want to create a program that can identify whether a picture contains a cat or a dog.

You could try to write rules:

If it has four legs

?

If it has two ears

If it has a tail

If it has fur

The problem is that both cats and dogs have most of these features.

There can also be thousands of different types of cats and dogs.

Writing all these rules manually would be extremely difficult.

Instead, we can give the computer many examples.

Cat picture

Cat

Dog picture

Dog

The computer analyses these examples and learns patterns.

Then we can give it a new picture:

New Picture

ML Model

"Cat"

This is the basic idea behind Machine Learning.


⚖️ Traditional Programming vs Machine Learning

This is one of the most important differences to understand.

Traditional Programming

In traditional programming, we provide the rules.

For example, to calculate the price after applying a discount:

Price = ₹1,000
Discount = 10%
Final Price = ₹900

We explicitly write the calculation.

The process looks like:

Rules + Data

Program

Result


Machine Learning

With Machine Learning, the approach is different.

We provide:

  • Data
  • Examples
  • Expected results

The machine-learning system learns patterns from those examples.

Data + Expected Results

Learning Process

Model

New Data

Prediction

So the key difference is:

Traditional ProgrammingMachine Learning
Developer writes rulesModel learns patterns
Rules are explicitPatterns are learned
Program + data → resultData + examples → model
Usually deterministicOften probabilistic

🗃️ What is Data?

Before going further, we need to understand one important word: data.

Data is simply information that we provide to a computer.

For example:

Name Age Salary
Rahul 25 ₹40,000
Priya 30 ₹60,000
Amit 28 ₹50,000

This is data.

Images are also data.

Image 1

Cat

Image 2

Dog

Image 3

Text is data.

Audio is data.

Videos are data.

Almost anything that can be stored and processed by a computer can be used as data.


📌 What Does “Learning” Mean?

When we say that a machine-learning model learns, it does not mean that the computer thinks like a human.

It means the system processes many examples and adjusts its internal mathematical values so that its predictions become better.

For example:

Training Examples

Machine Learning Algorithm

Learned Patterns

Model

We don’t need to understand the mathematics yet.

For now, remember:

Machine Learning uses data to find patterns that can be used to make predictions.


📈 What is a Machine Learning Model?

You will hear the word model many times in AI.

A machine-learning model is the result of the learning process.

Think of it like this:

Training Data

Machine Learning

Model

New Data

Prediction

For example, suppose we provide thousands of house records:

Size
Location
Number of bedrooms
Age of house
Price

The model can learn relationships between these values.

Later, if we provide a new house:

Size: 1,500 sq ft
Bedrooms: 3
Location: Bangalore
Age: 5 years

the model can estimate its price.

New House

ML Model

Predicted Price


⚙️ Training and Prediction

Machine Learning usually has two important stages.

1. Training

During training, the model learns from existing data.

Large Amount of Data

Training

ML Model

2. Prediction

After training, we give the model new data.

New Data

Trained Model

Prediction

For example:

Training:

House A

₹50 lakh

House B

₹70 lakh

House C

₹90 lakh

Learn patterns

Model

Prediction:

New House

₹75 lakh

The predicted value may not be perfectly correct. It is an estimate based on the patterns learned from the training data.


🤔 Why Do We Need Machine Learning?

Some problems are easy to solve using normal programming.

For example:

5 + 10 = 15

We don’t need Machine Learning for this.

We can simply write:

result = 5 + 10

But consider a different problem:

Can you identify whether an email is spam?

There can be millions of different spam messages.

It would be difficult to write a rule for every possible spam message.

Machine Learning can learn patterns from previous examples.

Spam Emails

Normal Emails

Machine Learning

Spam Detection Model

New Email

Spam / Not Spam

This is where Machine Learning becomes useful.


💡 Another Real-World Example: YouTube Recommendations

Suppose you regularly watch:

  • Java tutorials
  • Spring Boot tutorials
  • React tutorials
  • Software engineering videos

A recommendation system can analyse your activity.

Your Activity

Machine Learning Model

Learn Your Interests

Predict What You May Like

Recommended Videos

The system isn’t simply following one rule like:

IF user watches Java
THEN show Spring Boot

Modern recommendation systems can use many signals and learn complex patterns from large amounts of data.


⚠️ Machine Learning is Not Always Perfect

This is very important.

A machine-learning model learns from the data it receives.

If the data is:

  • Too small
  • Incorrect
  • Biased
  • Poor quality
  • Not representative

the model may produce poor results.

For example:

Good Data

Good Learning

Better Model

But:

Poor Data

Poor Learning

Poor Model

This is why data quality is extremely important in Machine Learning.


⚖️ Different Types of Machine Learning

There are several major approaches to Machine Learning.

The three commonly discussed categories are:

Machine Learning

Supervised Learning

Unsupervised Learning

Reinforcement Learning

Don’t worry if these names are new.

We’ll understand each one separately.

Supervised Learning

The model learns using examples where the correct answer is already provided.

Picture

Cat

Dog

Unsupervised Learning

The model receives data without predefined answers and tries to find patterns or groups.

Data

ML Model

Discover Groups / Patterns

Reinforcement Learning

The system learns by taking actions and receiving rewards or penalties.

Action

Result

Reward / Penalty

Learn

Try Again

We’ll cover these in detail later.


🤖 Machine Learning and AI

Now we can update our understanding of AI.

Artificial Intelligence

Machine Learning

Supervised Learning

Unsupervised Learning

Reinforcement Learning

So:

AI is the broader field, and Machine Learning is one of the major ways of building AI systems.


🧱 What About Deep Learning?

You may have heard another term:

Deep Learning.

Deep Learning is a type of Machine Learning that uses neural networks with multiple layers.

So our hierarchy becomes:

Artificial Intelligence

Machine Learning

Deep Learning

Neural Networks

And this is very important for our Generative AI journey.

Modern Generative AI systems such as large language models are built using deep-learning techniques.

But before we jump there, we need to understand Deep Learning and Neural Networks properly.


🧩 Key Points

Let’s summarise what we learned.

  • Machine Learning

    Machine Learning is a way of building AI systems that learn patterns from data and use those patterns to make predictions or decisions.

  • The basic process

    Data

    Training

    Model

    New Data

    Prediction

  • Traditional programming

    Rules + Data

    Program

    Result

  • Machine Learning

    Data + Examples

    Training

    Model

    Prediction

  • Most importantly

    Machine Learning is not the same as AI.

    Machine Learning is a major part of AI.


Now we know what Machine Learning is.

The next question is:

How does Machine Learning actually learn patterns from data?

To answer that, we’ll look at the three major types:

We’ll understand each one with simple real-world examples, before moving to Deep Learning.