Skip to content
Contents/CH 31
Distributed & Analytics/Intermediate · 14 min

Data Mining

Data mining is not just a big query. It is the search for patterns that were not explicitly requested.

In plain English

It is looking for patterns in a big box of receipts, not just finding one receipt.

The one idea

Data mining searches for patterns and predictions, not known records; the output is a model or rule that must be validated on data it did not see.

A query answers a question you already know how to ask. Mining proposes patterns you did not specify, which makes false discovery and overfitting the central risks.

By the end

  1. 01Define data mining.
  2. 02Distinguish classification, clustering, and association rules.
  3. 03Know the role of feature selection and evaluation.
  4. 04List common data-mining tools.
01

What mining adds

A normal query answers a known question, such as "How many orders in March?" Data mining looks for hidden structure. It might ask, "Which customers are likely to churn?" It combines statistics, machine learning, and database techniques on large datasets.

02

Core techniques

Classification predicts a label from labeled examples. Clustering groups similar records without labels. Association rules find items that co-occur, such as products bought together. Regression predicts a numeric value; anomaly detection finds unusual records.

chapter-31.db
classification: churn = yes/no
clustering:   group customers by behavior
association:  {bread} -> {butter}
regression:   predicted revenue
anomaly:      unusual transaction
03

Process and tools

A mining project selects data, cleans it, engineers features, trains a model, evaluates it on held-out data, and deploys it. Tools include SQL analytics, Python libraries such as scikit-learn, R, and dedicated platforms. The hard part is usually data quality and problem framing, not the algorithm.

Worked example3 steps

Market basket rules

A grocery chain records which items appear together in each basket.

01

Count baskets containing bread and butter together.

Support measures how often the combination occurs.

02

Measure how often butter appears when bread is present.

Confidence measures the strength of the rule bread → butter.

03

Test the rule on a later month.

If the pattern does not hold, it was a property of the training period, not the business.

ConclusionA mining result is a hypothesis until it survives held-out data. Support and confidence are not proof of causation.

The trade-off

No free correctness.

Gain

Discovery of structure that a fixed query would never ask for.

Cost

Overfitting, spurious correlations, privacy exposure, and models that decay.

Verdict

Treat every rule as a claim with a validation plan, not as a fact because the algorithm found it.

Recap

What to keep.

Takeaways

  • +Data mining finds patterns rather than answering a fixed query.
  • +Classification predicts labels; clustering groups unlabeled data.
  • +Association rules find co-occurring items.
  • +Evaluation on held-out data is essential.
  • +Data quality and problem framing dominate the work.

Traps

  • !Confusing a normal aggregate query with mining.
  • !Evaluating a model on the training data.
  • !Ignoring data leakage.

Focus

  • →Distinguish classification, clustering, and association.
  • →Explain why held-out evaluation matters.
  • →Name two tools used in practice.

Check yourself

Before you turn the page.

0 / 2 answered
01

Which technique groups unlabeled records by similarity?

02

What is an association rule?

DB//COSMOS

A field manual for database systems: model the domain, normalize the facts, query the relations, and protect the result.

Edition 2026 · 32 chaptersTopic catalogInterview prep