MACHINE LEARNING • LESSON 2

What Is an ML Problem?

Before choosing an algorithm or writing Python code, we need to understand the problem we are trying to solve.

Does every problem need Machine Learning?

No. Many problems can be solved with simple rules, formulas, database queries, or traditional software. Machine Learning becomes useful when we want a system to learn useful patterns from data.

01

Start With the Real-World Problem

A Machine Learning project usually starts with a real-world problem, not with an algorithm.

For example, imagine an online store wants to identify customers who are likely to buy a product.

REAL-WORLD PROBLEM Which customers are likely to buy this product?

The business wants an answer that can help it make a decision.

02

Turn the Problem Into Something We Can Learn

A computer cannot simply receive a vague business question and magically solve it.

We need to describe the problem using data.

BUSINESS QUESTION Who is likely to buy?
ML PROBLEM Predict whether a customer will buy
03

An ML Problem Needs Data

If we want a model to learn something, we need information from which it can learn.

CUSTOMER Customer A

Visited the product page 5 times.

CUSTOMER Customer B

Visited the product page once.

CUSTOMER Customer C

Added the product to the cart.

These examples give the system information about customers and their behavior.

04

We Need Something We Want the Model to Produce

Data alone is not enough. We also need to clearly define what we want the model to predict or decide.

INFORMATION Customer behavior
ML MODEL Learn relationship
OUTPUT Likely to buy?
05

The Core Structure of an ML Problem

Most Machine Learning problems can be understood by asking a few basic questions.

QUESTION 01 What information do we have?

These are the pieces of data available to the system.

QUESTION 02 What do we want to predict?

This defines the output we want from the model.

QUESTION 03 What examples can we learn from?

These examples provide the experience from which the model can learn.

QUESTION 04 How will we know if it works?

We need a way to evaluate the quality of the model's results.

06

Example: House Price Prediction

We can apply the same thinking to the house-price example from Lesson 1.

GIVEN House information

For example, house size.

PREDICT House price

The value we want the model to estimate.

Notice the structure.

We are not starting with "Which algorithm should I use?" We first define what information we have and what we want to predict.

07

Example: Spam Detection

Consider another problem: deciding whether an email is spam.

INPUT INFORMATION Email characteristics

Words, sender information, links, and other available information.

OUTPUT Spam or Not Spam

The decision we want the model to make.

08

Not Every Problem Needs ML

This is an important point. Using Machine Learning just because it is available is a bad engineering decision.

SIMPLE RULE Use traditional programming

Example: if the customer's cart is empty, disable the checkout button.

PATTERN FROM DATA ML may be useful

Example: estimate which customers are likely to purchase based on historical behavior.

09

A Good ML Problem Has a Clear Goal

Before building a model, we should be able to describe the problem clearly.

WHAT WE HAVE Data
+
WHAT WE WANT Target
+
HOW WE CHECK Evaluation
KEY IDEA

Don't start with the algorithm. Start with the problem.

First understand the real-world goal, identify the available data, define the desired output, and decide how success will be measured. Only then should we choose an appropriate Machine Learning approach.

QUICK CHECK

Can You Identify the ML Problem?

Example 1: Predict house price

What information could we use as input?

Example 2: Detect spam emails

What output do we want the model to produce?

Example 3: Recommend products

What customer information could help the system make the recommendation?

NEXT TOPIC

Input → Model → Output

Now that we know what an ML problem looks like, let's break its basic flow into three parts: input, model, and output.