Skip to main content

Welcome to a Grasp lesson

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

Lesson 41

Regression, Classification, and Clustering

Recommended resources

Hello! Welcome to your next lesson in the Predictive Analytics module.

In our last session, we mapped out the entire predictive modeling workflow, from defining a problem to building and evaluating a model. A key takeaway was that the first and most important step is identifying your target variable—the specific outcome you want to predict.

Learning Outcome: Differentiate between regression, classification, and clustering problems.

Today, we'll build directly on that foundation. The nature of your target variable—or even the absence of one—determines the type of predictive problem you're solving. This is the most critical decision you'll make before choosing any tools. We will explore the three fundamental types of predictive problems: regression, classification, and clustering. By the end of this lesson, you will be able to look at a business problem and confidently identify which type of analysis is needed.

1. Supervised vs. Unsupervised Learning

The first major branching point in predictive analytics is whether you have a known target variable. This distinction separates all models into two broad families: supervised and unsupervised learning.

  • Supervised Learning: You have a dataset with historical outcomes (a "labeled" dataset), and your goal is to build a model that can predict this outcome for new, unseen data. The model learns from the "supervision" of the correct answers in your training data. Classification and regression fall into this family.
  • Unsupervised Learning: You have a dataset without a specific, known outcome to predict ("unlabeled" data). Your goal is to explore the data and discover hidden patterns, structures, or relationships within it. Clustering is the most common type of unsupervised learning.

To get a clear overview of these concepts, let's watch a short, helpful video.

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

The video 'Machine Learning Problem Types' by Tiny Technical Tutorials provides an excellent and concise explanation of the core problem types. It uses simple examples that make the differences very clear.

Please watch from the beginning until the timestamp 03:10. Focus on: The definition of supervised learning and its reliance on labeled data. How classification predicts a category (e.g., yes/no). How regression predicts a continuous value (e.g., price). The definition of unsupervised learning and its use of unlabeled data to find patterns, as seen in clustering.

Now that you have a high-level understanding, let's dive into each type in more detail.


2. Supervised Learning: Classification vs. Regression

When your goal is to predict a specific target variable, you are doing supervised learning. The key is to look at the type of target variable to determine whether it's a classification or a regression problem.

Visualizing Classification vs. Regression
This image provides a clear visual distinction. **Classification** (left) is about separating data into distinct groups or categories. **Regression** (right) is about finding a line or curve that best fits the data to predict a numerical value.

Classification: Predicting a Category

In a classification problem, your target variable is categorical. You are trying to predict which predefined class, category, or group an observation belongs to.

  • Key Question: "Which category?" or "Is this A or B?"
  • Target Variable Type: Categorical.
  • Examples:
    • Will a customer churn? (Yes / No)
    • Is this email spam? (Spam / Not Spam)
    • Which product category will a customer be most interested in? (Electronics / Clothing / Home Goods)

Classification problems can be further divided:

  • Binary Classification: The target has only two possible outcomes (e.g., Yes/No, True/False).
  • Multi-class Classification: The target has three or more possible outcomes (e.g., High/Medium/Low risk).

AI techniques explained: Generative AI, regression, classification and clustering

The article 'AI techniques explained' offers clear definitions and business use cases for each model type. Let's read the section on Classification to solidify our understanding.

Please read the section titled 'Classification: Categorizing data'. Pay attention to the definition and the distinction between binary and multi-class problems.

Regression: Predicting a Number

In a regression problem, your target variable is continuous and numerical. You are trying to predict a specific quantity or amount.

  • Key Question: "How much?" or "How many?"
  • Target Variable Type: Numeric.
  • Examples:
    • What will be the price of this house? ($450,000, $525,300, etc.)
    • How many units of this product will we sell next month? (1,200, 1,550, etc.)
    • What will the temperature be tomorrow? (75°F, 82.5°F, etc.)

AI techniques explained: Generative AI, regression, classification and clustering

Now, let's read the section on Regression from the same article to understand how it contrasts with classification.

Please read the section titled 'Regression: Predicting continuous values'. Focus on its purpose of predicting continuous values and the business examples provided.


3. Unsupervised Learning: Clustering

What if you don't have a specific outcome to predict? What if you simply want to understand the natural structure of your data? This is where unsupervised learning, and specifically clustering, comes in.

In a clustering problem, you are not predicting a target variable. Instead, you are asking the algorithm to analyze your data and group similar records together based on their attributes.

  • Key Question: "What are the natural groups in my data?"
  • Target Variable Type: None.
  • Examples:
    • Segmenting customers into groups based on purchasing habits (e.g., "High-Value Shoppers," "Bargain Hunters," "New Customers").
    • Grouping patients with similar medical characteristics to identify different disease subtypes.
    • Identifying stores with similar performance profiles.

AI techniques explained: Generative AI, regression, classification and clustering

Finally, let's read the section on Clustering to complete our understanding of the three main problem types.

Please read the section titled 'Clustering: Discovering hidden structures'. Note that it is an unsupervised technique and that it works with unlabeled data.


4. Practice and Summary

Let's test your understanding with the quick quiz from the video we watched earlier.

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

Now, let's revisit the 'Machine Learning Problem Types' video and watch the final section where the host presents a few examples. Try to answer the questions yourself before the video reveals the solution.

Watch the video from 03:46 to the end. Pause after each question is presented and decide if it's a classification, regression, or clustering problem before continuing to hear the answer.

To bring it all together, here is a summary table that contrasts the three techniques.

Technique Goal Data Requirement Example Question
Regression Predict a continuous numerical value. Labeled data with a numeric target. "How much will we sell?"
Classification Assign a category or class label. Labeled data with a categorical target. "Will this customer leave?"
Clustering Discover natural groups in the data. Unlabeled data (no target variable). "What are our customer segments?"

5. Connecting to Alteryx

So, how does this all relate to your work in Alteryx? The platform has specific tools designed for each of these problem types. Choosing the right family of tools is your first step.

The decision tree below is a fantastic guide for selecting the right predictive approach in Alteryx.

Alteryx Predictive Modeling Decision Tree
This flowchart guides you through the process of selecting a predictive model in Alteryx. It starts with the key question: "Is my training data already classified?" If not, it points towards **clustering** (unsupervised). If yes, it guides you through **classification** options based on the number of groups and other factors.

As you can see, the very first decision point separates clustering from classification, reinforcing the supervised vs. unsupervised distinction.

To make this even more concrete, the Alteryx Predictive tool palette contains tools specifically for each model type.

Alteryx Analytics: Intro to Predictive Model Selection

The article 'Intro to Predictive Model Selection' from The Data School blog provides a helpful list of which Alteryx tools correspond to each predictive method. This will help you navigate the tool palette.

Please read the section under the 'Methods' heading. Focus on the lists of Alteryx tools available for Clustering, Classification, and Regression.

Knowing these categories will be essential as we move forward. If you have a regression problem, you'll know to look for tools like Linear Regression. If you have a classification problem, you'll look for Logistic Regression or Decision Tree. And if you're exploring for segments, you'll start with tools like K-Centroids Cluster Analysis.


Conclusion

Great job! You've just learned one of the most fundamental concepts in predictive analytics. Being able to correctly identify your problem type is the foundation upon which all successful predictive models are built.

Key Takeaways:

  • Predictive problems are primarily divided into supervised (predicting a known target) and unsupervised (finding hidden patterns) learning.
  • Regression predicts a continuous numeric value (e.g., price, quantity). The key question is "How much?".
  • Classification predicts a discrete category or class (e.g., yes/no, high/medium/low). The key question is "Which category?".
  • Clustering identifies natural groups in your data without a predefined target. The key question is "What are the natural groups?".
  • Alteryx has dedicated tools for each of these problem types, and your first step is always to choose the correct family of tools based on your business question.

Preview of the Next Lesson:

Now that you can identify your problem type, the next step in our workflow is to ensure our data is clean and ready for modeling. In our next lesson, we will focus on a critical data preparation task: handling missing values using the Imputation tool.