Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 2

Distinguishing Machine Learning Tasks

Recommended resources

Introduction

In our previous lesson, we established the three main paradigms of machine learning: supervised, unsupervised, and reinforcement learning. We learned that this high-level distinction is the first step in framing any ML problem.

This lesson builds directly on that foundation. We will focus on the most common tasks that fall under supervised and unsupervised learning, addressing the learning outcome: Differentiate between classification, regression, and clustering tasks given a business problem.

For the Google Cloud Professional ML Engineer exam, you will frequently be presented with a business scenario and expected to identify the correct ML approach. This lesson will equip you with the mental model to do just that by focusing on three core tasks:

  • Classification: Predicting a category.
  • Regression: Predicting a numerical value.
  • Clustering: Discovering natural groupings in data.

Framing the Problem: Supervised vs. Unsupervised Tasks

As a quick recap, supervised learning uses labeled data to make predictions, while unsupervised learning finds patterns in unlabeled data. Classification and regression are supervised tasks, whereas clustering is an unsupervised task.

The following diagram visually organizes these concepts, showing how today's topics fit into the broader ML landscape we discussed previously.

Machine Learning Algorithm Classification Diagram
This diagram illustrates the relationship between learning paradigms (Supervised, Unsupervised) and the specific task types (Regression, Classification, Clustering) that we will cover in this lesson.

1. Classification: Predicting a Category

A classification task involves predicting a discrete category or class. The output of a classification model is a label, such as "spam" or "not spam," "cat" or "dog," or "fraudulent" or "legitimate."

To begin, let's watch a short, clear explanation of classification.

Machine Learning Problem Types: Classification, Regression, Clustering and More! | AI for Beginners

This video from Tiny Technical Tutorials provides a concise introduction to classification, explaining the difference between binary (two choices) and multi-class (many choices) problems.

Watch the segment from 00:21 to 01:22. Note the emphasis on using labeled data to predict a defined, categorical choice.

Types and Business Use Cases

For the exam, it's important to recognize different flavors of classification based on the number of possible output labels.

Classification Algorithms for Business

The following text from ThinkPalm provides clear definitions and a business use case for different classification types.

Read the section titled '2. Classification'. Pay close attention to the descriptions of binary, multiclass, and multilabel classification. The business use case about automatically assigning tags to helpdesk conversations is a perfect example of a multi-label classification problem.

Key Takeaways for Classification:

  • Goal: Assign an item to a predefined category.
  • Learning Type: Supervised (requires labeled historical data).
  • Output: A class label (e.g., True/False, Red/Green/Blue, High/Medium/Low).
  • Example Business Problems:
    • Will a customer churn? (Binary classification: yes or no).
    • What is the topic of this news article? (Multi-class classification: sports, politics, or technology).
    • Which tags apply to this blog post? (Multi-label classification: AI, GCP, and Vertex AI could all apply).

2. Regression: Predicting a Number

A regression task involves predicting a continuous numerical value. Instead of predicting what something is, you predict how much or how many.

Let's watch the next segment of the same video for an explanation of regression.

Machine Learning Problem Types: Classification, Regression, Clustering and More! | AI for Beginners

This next clip explains regression, contrasting it with classification by highlighting that the output is a continuous value, not a category.

Watch the segment from 01:22 to 02:14. The example of predicting rent price based on the number of bedrooms clearly illustrates how regression models work with continuous values.

Business Use Cases

Regression models are widely used in business for forecasting and estimation.

Regression: Predicting continuous values

To see how regression is applied in a business context, please read the following section from Montrose Software.

Read the section titled 'Regression: Predicting continuous values'. Focus on the 'Use cases' and 'Other examples' subsections, such as stock price prediction, sales forecasting, and estimating project timelines.

Key Takeaways for Regression:

  • Goal: Predict a continuous, numerical value.
  • Learning Type: Supervised (requires historical data with known numerical outcomes).
  • Output: A number (e.g., 17.50, 365, 10923.45).
  • Example Business Problems:
    • What will be the price of a house next year?
    • How many units of a product will we sell next quarter?
    • How long will it take for a support ticket to be resolved?

3. Clustering: Discovering Groups

A clustering task is fundamentally different because it is unsupervised. You don't have labeled data. Instead, the goal is to give the model a dataset and have it discover natural groupings or "clusters" of similar data points on its own.

Let's complete our viewing with the segment on clustering.

Machine Learning Problem Types: Classification, Regression, Clustering and More! | AI for Beginners

This final clip explains clustering, emphasizing that it works with unlabeled data to find hidden patterns or segments.

Watch the segment from 02:14 to 03:32. The customer segmentation example is a classic use case for clustering that you should be familiar with.

Business Use Cases

Clustering is powerful for exploratory data analysis and customer intelligence.

Clustering: Discovering hidden structures

For a formal definition and more business examples, let's review a short text on clustering.

Read the section 'Clustering: Discovering hidden structures'. Note the use cases like customer segmentation and anomaly detection.

Key Takeaways for Clustering:

  • Goal: Group similar items together based on their features.
  • Learning Type: Unsupervised (does not require labeled data).
  • Output: A cluster ID for each item (e.g., Group 1, Group 2). The meaning of the groups must be interpreted by a human analyst.
  • Example Business Problems:
    • Segmenting customers based on purchasing behavior for targeted marketing campaigns.
    • Grouping servers in a data center by their performance metrics to identify anomalies.
    • Categorizing documents by topic without any predefined topic list.

Putting It All Together: Comparison and Practice

Now that we've defined each task, let's consolidate the key differences. The image below provides a quick, side-by-side comparison that is excellent for exam memorization.

Comparison of Regression, Classification, and Clustering
This table provides a concise summary of the key differences between Regression, Classification, and Clustering across dimensions like learning type, output, and aim.

For a slightly more detailed comparison, you can also review the summary table in the article from Montrose Software.

Comparing the techniques: Strengths and weaknesses

This table provides a quick reference for the strengths and weaknesses of each technique, which is useful for deciding which approach to use.

Review the table in the 'Comparing the techniques: Strengths and weaknesses' section. You can ignore the 'Generative AI' row for now.

Test Your Understanding

Let's apply what you've learned. The following video segment presents three business scenarios. For each one, pause and decide whether it's a classification, regression, or clustering problem before the answer is revealed.

Machine Learning Problem Types: Classification, Regression, Clustering and More! | AI for Beginners

This is a great opportunity to test your ability to apply these concepts, just as you would on the exam.

Watch from 03:46 to 05:20. Actively participate by pausing the video after each question is posed to formulate your own answer.


Conclusion

In this lesson, we dissected the three most common machine learning tasks you'll encounter. Correctly identifying the problem type is the first critical step in any ML project.

Key Takeaways:

  • Regression: Predicts a continuous number (e.g., price, temperature). It is a supervised task.
  • Classification: Predicts a discrete category (e.g., spam/not spam, cat/dog). It is a supervised task.
  • Clustering: Discovers hidden groupings in data (e.g., customer segments). It is an unsupervised task.

The decision framework is straightforward:

  1. Are you predicting a specific outcome based on past examples? If yes, it's supervised learning.
    • Is the outcome a number? → Regression
    • Is the outcome a category? → Classification
  2. Are you trying to find inherent structure in your data without pre-existing labels? → Unsupervised Learning → Clustering

In our next lesson, we will move on to the building blocks of the data itself. We will define key ML terminology: features, labels, training/validation/test sets, overfitting, and underfitting. This will prepare us to understand how we actually prepare data to train the models we've discussed today.