Concepts / Exploratory Setting for Unsupervised Learning

Exploratory Setting for Unsupervised Learning

Unsupervised algorithms are often used in an exploratory setting, where a data scientist wants to understand the data better rather than run them inside a larger automatic system.

  • Programming

Following One Dataset Through Two Roles

Unsupervised learning is easy to describe in the abstract, but a working data scientist needs a more useful question: what are these methods actually for? In practice, unsupervised algorithms show up in two main roles. The first is as a tool for looking at data itself, helping a person build an understanding of what a dataset contains. The second is as a helper inside a larger pipeline, where the output of an unsupervised step feeds into a supervised algorithm. This article walks through both roles using one hypothetical scenario, and it ends with the pitfalls that catch people out.

The scenario works like this. A data scientist receives a table of unlabeled customer records from a small online shop. Nobody has tagged the rows with categories or outcomes. The data scientist wants to know what the table contains before deciding anything. Later in the same project, a second team wants to predict whether a customer will return, and it plans to use a supervised algorithm for that task. Both situations involve unsupervised methods, but they use them in different ways. Keep this scenario in mind as the article proceeds.

What do you think happens?

Before anyone builds a model, what is the first thing the data scientist in the scenario wants from an unsupervised method?

  • A final prediction for every customer record

  • An understanding of what the dataset contains

  • An automatic decision about which customers to contact

Reveal answer
Answer:

An understanding of what the dataset contains

The first role of unsupervised algorithms is as a tool for looking at data itself, helping a person build an understanding of what a dataset contains. The goal is insight, not an automated decision.

The Exploratory Setting

A large share of unsupervised work happens in an exploratory setting. Here the goal is not to hand a decision over to an automated system. Instead, a data scientist wants to understand the data better, and the unsupervised algorithm acts as a lens for that understanding. The results inform the person's judgment about the dataset. This is why these methods are typically used on their own, rather than as one component of a larger automatic system.

Definition

An exploratory setting is a way of using an unsupervised algorithm in which a data scientist wants to understand the data better, and the algorithm's results inform that person's judgment rather than being fed into an automatic system.

Data scientistRaw dataUnsupervisedalgorithmUnsupervised stepUnderstanding of thedataLarger automaticsystemuses to look at datainforms judgmentfeeds inis one component of
How does a data scientist using an unsupervised method to understand data differ from the same method embedded as a step in an automated system?

The two columns of the diagram use the same kind of algorithm, but the purpose differs. In the exploratory column, the person sits at the center and the algorithm's output is judged by that person. In the automated column, the algorithm is one part of a chain, and the surrounding system consumes what it produces. Returning to the scenario, the data scientist who is examining the shop's customer table is working in the exploratory column. Nothing downstream is waiting on the result, so the value lies in what the data scientist learns from it.

Unsupervised Learning as a Preprocessing Step

The second common application treats an unsupervised algorithm as a preprocessing step. Rather than feeding the raw data straight into a supervised algorithm, the pipeline first passes the data through an unsupervised step that learns a new representation of it. The supervised algorithm then works with this transformed version of the data. The important thing to track is the direction of information flow. The data enters in its original form, the unsupervised step reshapes it, and the reshaped data is what the supervised algorithm learns from.

Raw dataoriginal formUnsupervised steplearns a new representationNew representationtransformed version of thedataSupervised algorithmlearns from the transformeddataenters in original formreshapesis consumed by
How does data flow from raw input through an unsupervised transformation into a new representation that a supervised model then consumes?
  1. 1
    Raw data enters the pipeline in its original form.
  2. 2
    The unsupervised step learns a new representation of that data and reshapes it.
  3. 3
    The new representation is passed on in place of the raw data.
  4. 4
    The supervised algorithm learns from the transformed version of the data.

What do you think happens?

In the pipeline above, which data does the supervised algorithm learn from: the raw data or the new representation?

  • The raw data

  • The new representation

Reveal answer
Answer:

The new representation

The supervised algorithm works with the transformed version of the data. The unsupervised step sits between the raw input and the supervised algorithm, so the raw data never reaches the supervised algorithm directly in this design.

Applying this to the second team in the scenario, they would not send the raw customer table directly to the return-prediction model. They would insert an unsupervised step that produces a new representation of the customer records, and the prediction model would learn from that representation instead.

Accuracy, Memory, and Time as Separate Outcomes

The reason to add an unsupervised step to a supervised pipeline is that a new representation of the data can change how well the supervised algorithm performs. The source identifies two kinds of benefit. One is accuracy: a new representation can sometimes improve the accuracy of supervised algorithms. The other is resource use: a new representation can lead to reduced memory and time consumption. The before-and-after view below shows how these outcomes branch from the same change in representation.

Originalrepresentationdata in its original formNew representationreshaped by unsupervisedstepAccuracycan improveMemory usecan decreaseTime usecan decreaseunsupervised stepmeasure separatelymeasure separatelymeasure separately
How does the transformed representation change what the supervised algorithm works with, and which outcomes can it affect?

For the customer scenario, this means the second team should not assume that a new representation of the customer records will make the return-prediction model more accurate, faster, and smaller all at once. It should compare the model with and without the unsupervised step, and record accuracy, memory use, and time use as three separate results.

Walking the Scenario Through Both Roles

Worked example

Choosing the Role for the Customer Records

The data scientist has an unlabeled table of customer records and wants to understand it. A second team wants to predict whether a customer will return, using a supervised algorithm. Decide how the unsupervised method is used in each case, and what should be measured.

  1. 1
    Identify the first goal

    The data scientist wants to understand what the table contains. This is the exploratory role: the unsupervised algorithm is a lens, and its results inform the person's judgment.

  2. 2
    Keep the exploratory result with the person

    Nothing downstream consumes the result automatically, so the data scientist reads it, interprets it, and draws conclusions about the dataset.

  3. 3
    Identify the second goal

    The return-prediction team wants a supervised model. The unsupervised method is used as a preprocessing step, so the supervised algorithm learns from a new representation rather than the raw records.

  4. 4
    Measure each outcome separately

    The team records the supervised model's accuracy, its memory use, and its time use, with and without the unsupervised step. Because none of these benefits is guaranteed, each one is a separate result.

Result

The same family of unsupervised methods serves two different purposes. In the exploratory case it helps a person understand the data. In the pipeline case it produces a new representation that the supervised algorithm learns from, and its benefits are judged by separate measurements of accuracy, memory use, and time use.

Mistakes That Catch Practitioners Out

  • Common mistake

    Treating an exploratory result as if it were an automatic decision

    What it looks like

    A data scientist runs an unsupervised method to look at customer records, then passes the output straight into an automated system that acts on it without any review.

    Why it fails

    In an exploratory setting, the goal is to inform the person's judgment about the dataset. The results are meant to be read and interpreted, not consumed automatically.

    Do this instead

    Keep the person in the loop for exploratory results. If the output is to feed an automated system, treat that as a deliberate pipeline design and evaluate it as one.

  • Common mistake

    Assuming a new representation always improves accuracy

    What it looks like

    A team adds an unsupervised step to a supervised pipeline and reports the change as an improvement without checking the supervised model's results.

    Why it fails

    The source says a new representation can sometimes improve accuracy. It does not say it always does, so the benefit is not guaranteed.

    Do this instead

    Measure the supervised model's accuracy with and without the unsupervised step, and report what the comparison actually shows.

  • Common mistake

    Bundling accuracy, memory, and time into one judgment

    Why it fails

    Accuracy and resource savings are separate outcomes. A representation that helps one may not help the others, and neither is guaranteed to appear.

    Do this instead

    Record accuracy, memory use, and time use as distinct measurements, and interpret each one on its own.

Applying the Two Roles

MEDIUM

A team has an unlabeled dataset of product reviews. One member wants to understand the main patterns in the reviews before deciding anything. Another member wants to use an unsupervised step to produce a new representation of the reviews, which a supervised algorithm will use to predict review ratings. Explain which role each member is playing, describe the direction of information flow in the second plan, and name the three outcomes the team should measure separately.

Hints
  • Ask whether the result is meant to inform a person's judgment or to be consumed by a downstream algorithm.
  • In a preprocessing pipeline, think about which data enters the unsupervised step and which data the supervised algorithm learns from.
  • The source names accuracy, memory use, and time use as the benefits to consider, and it says none of them is guaranteed.

Pulling the Two Roles Together

Unsupervised algorithms appear in two main roles. As an exploratory tool, they help a data scientist build an understanding of a dataset, and their results inform that person's judgment. As a preprocessing step, they produce a new representation of the data that a supervised algorithm learns from. The benefits of that new representation, whether in accuracy, memory use, or time use, must be measured separately because none of them is guaranteed.

Key Takeaways

  • Unsupervised algorithms are often used in an exploratory setting, where a data scientist wants to understand the data rather than run the algorithm inside a larger automatic system.
  • An unsupervised step can serve as preprocessing: raw data enters, the step learns a new representation, and the supervised algorithm learns from that transformed data.
  • A new representation can sometimes improve supervised accuracy and can lead to reduced memory and time consumption, but neither outcome is guaranteed.
  • Accuracy, memory use, and time use should be measured separately, and results from exploratory use should be interpreted by a person rather than treated as automatic decisions.

Related concepts

More concepts starting with E