Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 39 ยท Getting Started

Data Mining Tasks and Applications

A tour of the main data mining tasks: classification, regression, clustering, association rules, anomaly detection and more, with a tiny Python example for each.

"Data mining" is a family of tasks, not one method. Before you pick an algorithm you must name the task, because the task decides what data you need, what the output looks like and how you judge success. This lesson is a map of the tasks, with one short runnable example of each so that the vocabulary becomes concrete.

Descriptive and predictive tasks

The first split is by purpose:

  • Descriptive tasks characterize the data as it is: groups, associations, summaries, outliers.
  • Predictive tasks use some columns to estimate another one: a category or a number.
flowchart TD
    M["Data mining tasks"] --> D["Descriptive"]
    M --> P["Predictive"]
    D --> D1["Clustering"]
    D --> D2["Association rules"]
    D --> D3["Summarization"]
    D --> D4["Anomaly detection"]
    P --> P1["Classification"]
    P --> P2["Regression"]
    P --> P3["Forecasting"]

Anomaly detection can be either: unsupervised (descriptive) or trained on labeled fraud examples (predictive).

Classification

Classification assigns a record to one of a fixed set of classes: spam or not spam, disease or healthy, low, medium or high risk. The model learns from rows whose class is known (supervised learning).

Python Classification: spam or not?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Regression and forecasting

Regression predicts a number: a house price, a delivery time. Forecasting is regression where time is the key input: tomorrow's sales from past sales.

Python Regression: price from size

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Clustering

Clustering finds groups of similar records with no labels given (unsupervised learning). Retailers use it to segment customers.

Python Clustering: three natural groups

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Association rule mining

Association rules express "baskets that contain A tend to contain B". The classic setting is shopping, but it also works for web pages visited together, symptoms that co-occur, or software features used in the same session.

Python Association: support and confidence

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Chapter 4 develops these two numbers into complete algorithms.

Anomaly (outlier) detection

Anomaly detection finds records that differ sharply from the rest: a fraudulent payment, a failing sensor, an intrusion.

Python Anomaly: a z-score check

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

More tasks you will meet

  • Summarization and characterization: compact descriptions of a data set or class ("typical churned customer").
  • Discrimination: contrast two classes ("what separates buyers from non-buyers?").
  • Sequential pattern mining: ordered events, such as "buy a phone, then a case within a week".
  • Link analysis: structure of networks, such as web pages or social graphs.
  • Text mining: topics, sentiment and entities from documents (Chapter 8).
  • Recommendation: suggest items from similar users or items.

Choosing a task

Which task fits my question?

Known categories? Classification.
A number to predict? Regression.
Find groups? Clustering.
Co-occurrence? Association rules.

Rare odd records? Use anomaly detection.

1 / 2

Applications by industry

Industry Typical question Task
Retail What is bought together? Association rules
Banking Will this loan default? Classification
Insurance Is this claim suspicious? Anomaly detection
Telecom Which customers will leave? Classification
Marketing Which segments do we have? Clustering
Energy How much power tomorrow? Forecasting
Healthcare Which patients are alike? Clustering
Web Which pages relate? Link analysis, text mining

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Grouping customers with no predefined labels is an example of:

    Clustering is unsupervised: it discovers groups instead of learning given labels.
  2. 2. Predicting the price of a house in dollars is:

    The target is a number, so it is a regression task.
  3. 3. Which task finds items that are often bought together?

    Association rules describe co-occurrence in transactions.
  4. 4. Which pair is correct?

    Supervised methods learn from known targets. Clustering is unsupervised; regression predicts numbers.

Summary

  • Tasks are descriptive (clustering, associations, summaries, anomalies) or predictive (classification, regression, forecasting).
  • Name the task first: it decides the data, algorithm and metric.
  • Supervised learning needs labels; unsupervised does not.
  • Other tasks include sequential patterns, link analysis, text mining and recommendation.

Next: Data Types and Data Quality