} -->

Supervised Learning in Machine Learning Explained: Your Beginner's Guide for AWS ML Associate Prep #2

 In our last post, we had seen How AI Recommends You a Product to Buy on Amazon & Other E-commerce Sites (link to post if you hadn't seen), as a continutity to it, let's dive into the core machine learning concept that powers many such predictive AI models: Supervised Learning.

Also Read : What is Artificial Intelligence (A.I), GenAI and its future?

Let's begin..

What is Supervised learning?

Understanding supervised learning is foundational for anyone aspiring to become an AWS Machine Learning Associate. So, let's dive deep into this core machine learning concept.

Lets say you want a computer to tell whether a photo is of a cat or a dog.
  • You give it thousands of photos, each labeled as “cat” or “dog.”

  • It studies them like flashcards.

  • Later, when you give it a new photo with no label, it guesses what it is based on what it’s learned.

 That’s called supervised learning.

This Supervised learning has two types.

  1. Classification Problem
  2. Regression Probelm

What is Classification Problem in Machine learning ?

In a classification problem, the goal is to teach the computer how to assign data to one or more classes, or categories.

Wait, what does this classes mean in A.I?


Classes are nothing but just labels used to describe different kinds of data. They tell the computer what kind of thing it’s looking at.

Example: If we are categorizing the Email as fraud or not then, here Fraud will be called class. So, in this example, there are two classes. 

Fraud  (Class 1), Not fraud (Class 2)

Another example is whether the particular customer will buy the product or not?

Here will buy is class 1 and will not buy is class 2.'

Clear.?

Now, this classification is also of two types.

1) Binary classification
2) Multi class Classification


What is Binary classification in ML ?

As the name suggest, Binary means only one - Either true or false! Dont confuse much.

In other words, binary classification is a type of classification problem in machine learning where the goal is to sort data into one of two classes—just two options.

Let's see one example based on Covid -19 the one, which we survived! In a hospital setting, an AI system can be trained to analyze COVID-19 test results using thousands of past cases labeled as either “Positive” or “Negative.”

By studying patterns in the data—such as symptoms, oxygen levels, and X-ray images—the AI learns to recognize which indicators point to infection. When a new patient’s information is entered, the system uses what it has learned to predict one of two outcomes: either the patient is COVID-positive (Class A) or COVID-negative (Class B). This is known as binary classification—where the AI sorts each case into one of just two categories.

Okay, What is Multi Class Classification in Machine Learning.?

Here, as multi is coming into picture, its the same way, In multi-class classification, an AI system learns to sort data into more than two categories, not just a simple yes-or-no.

Let's see one example for this too..

Imagine an AI model trained to identify animals from photos. It’s shown thousands of images, each clearly labeled—“Cat,” “Dog,” “Elephant,” “Tiger,” and so on. By learning the features of each animal—like fur patterns, ear shapes, body size, and snouts—it begins to recognize what makes each animal different. So when you show it a new picture of an animal, it doesn’t just say “Is this an animal or not?” (that would be binary). Instead, it picks the most likely label from multiple options. If it sees stripes and pointy ears, it might say “Tiger.” If it spots floppy ears and a wagging tail, “Dog.”

Similarly, if you are going for Movie Rating..

1 Star, 2 star, 3 star are just the classes.

When you're building such classification models on AWS, you'd often use services like Amazon SageMaker. SageMaker provides built-in algorithms for various classification tasks, simplifying the process of model training and deployment.
We will see them in coming posts. But for now, lets learn the basics.

Regression Problems.:

Now, lets switch gear and understand 

What is Regression Problem in Supervised learning?

First, what is regression?

Simple, Regression is like making an educated guess based on examples you’ve seen before. Say you’re trying to figure out how much your electricity bill will be next month. You’d look at things like past bills, how hot the weather might be (because of fans or AC), and how many people are home. Using that info, you’d estimate a number—maybe $1,500 (i know u wont spend that much money for electricity, just sharing for example 😂😂)

That’s regression: it’s all about predicting a number based on patterns. Whether you’re guessing someone’s age from their photo, how long a trip will take, or what score you’ll get on a test—it’s like smart guessing backed by past examples.

In a regression problem, the goal is to predict a numerical value based on patterns found in data. Instead of deciding between categories like “cat” or “dog,” the computer estimates things like price, temperature, age, or score.

For example: Imagine an app that helps people estimate the price of a house. It looks at details like how many bedrooms the house has, how big it is, and the neighborhood it’s in. After learning from thousands of past examples, it can guess that a new house might cost ₹1.2 million. It doesn’t say “cheap” or “expensive” — it gives a number.

That’s regression: using data to predict a value. One real word example, you might see is Stock Market. If a website shows this Nasdaq or share of bitcoin will reach $50000000 in 2080 then thats regression!

Let's close this post, with a recap on whats difference between Classification problems and regression problems.

FeatureClassificationRegression
🎯 GoalAssign data to a categoryPredict a numerical value
🧠 Type of OutputDiscrete labels (e.g., Cat, Dog)Continuous numbers (e.g.,1,200,000)
🎓 Example Use CasesSpam detection, disease diagnosisHouse pricing, age prediction
🔢 Number of ClassesTwo (binary) or more (multi-class)Just one continuous value
📦 Prediction Format“A” or “B” or “C”…₹15.2, 98.5 km/h, 37°C, etc.
📊 Visual OutputBar charts, confusion matrixLine graphs, scatter plots

To sum up:

  • Classification answers: “What is this?”

  • Regression answers: “How much?” or “What’s the value?”

We will start learning, what is unsupervised learning in machine learning which is another critical topic in the next post. Stay tuned!