Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Data Mining

Data mining finds patterns, associations, clusters, and anomalies in large datasets with statistics and machine learning, the analysis step of KDD.

Data mining is the process of discovering useful patterns in large datasets, such as items that occur together, natural groups, predictive rules, and unusual records, using statistics, machine learning, and database techniques. Formally, data mining is the analysis step of knowledge discovery in databases (KDD), which Usama Fayyad, Gregory Piatetsky-Shapiro, and Padhraic Smyth described in 1996 as a sequence of data selection, data preprocessing, transformation, mining, and interpretation of the results.

The Data Mining Process#

A widely used process model is CRISP-DM, the Cross-Industry Standard Process for Data Mining, which a consortium including Teradata, Daimler, and NCR first presented in 1999. Its six phases loop back on each other whenever a later phase exposes a gap in an earlier one:

Data preparation, which includes data cleaning, joining sources, and feature engineering, is typically the longest phase, and modeling sends the team back to it whenever a pattern turns out to be an artifact of missing or duplicated records.

Core Techniques#

  • Association rule learning: Finds items or events that occur together, as in market basket analysis. Rakesh Agrawal and Ramakrishnan Srikant's Apriori algorithm from 1994 made it practical on large transaction databases.
  • Clustering with k-means or DBSCAN: Groups similar records without labels, such as customer segments or similar images, as a form of unsupervised learning.
  • Classification with decision trees: Learns rules that assign records to known categories, such as approving or flagging a loan application, from labeled history.
  • Anomaly detection: Flags records that differ sharply from the rest, such as fraudulent card transactions or a machine whose sensor readings drift from normal.
  • Sequential pattern mining: Finds ordered patterns, such as the page paths that most often lead to a purchase.

Association rules are scored with three numbers. Support is the share of transactions that contain both items, confidence is the share of transactions with item A that also contain item B, and lift divides confidence by how common B is on its own, so a lift above 1 means A and B occur together more often than chance predicts. This example scores every pair of products in eight shopping baskets with pandas:

from itertools import permutations

import pandas as pd

# Eight shopping baskets, one column per product
baskets = pd.DataFrame(
    [[1, 1, 0, 1], [1, 1, 0, 0], [0, 1, 1, 0], [1, 1, 1, 1], [1, 0, 0, 1], [0, 0, 1, 0], [1, 1, 0, 1], [0, 1, 1, 0]],
    columns=["bread", "butter", "milk", "jam"],
).astype(bool)

# Score every rule "A -> B" and keep frequent rules that beat chance
for a, b in permutations(baskets.columns, 2):
    support = (baskets[a] & baskets[b]).mean()  # share of baskets with both items
    confidence = support / baskets[a].mean()  # share of A baskets that also hold B
    lift = confidence / baskets[b].mean()  # confidence relative to B's base rate
    if support >= 0.25 and lift > 1:
        print(f"{a} -> {b}: support {support:.2f}, confidence {confidence:.2f}, lift {lift:.2f}")

It prints four rules. The rule bread → butter has a high confidence of 0.80 but a lift of only 1.07, because butter is in three of every four baskets anyway, while bread → jam has the same confidence and a lift of 1.60. The rule milk → butter has a confidence of 0.75 and a lift of exactly 1.00, so the filter drops it.

Data Mining in Computer Vision#

Image and video collections are mined for the examples that matter most to a model. Hard negative mining selects background regions that a detector wrongly scores as objects and trains on them again, and active learning mines unlabeled pools for the images a model is least sure about. Mining a deployed system's detection logs reveals recurring defect types on a manufacturing line or peak hours in a store, and embeddings let teams cluster millions of images by content to find duplicates and gaps.

Ultralytics Platform mines datasets this way with its Clustering panel, which computes an embedding for every image and projects the dataset into an interactive 2D scatter plot where visually similar images sit close together, so users can color points by split, class, or cluster, spot duplicates and outliers, and lasso a region to inspect, relabel, or move those images.

  • Machine learning: Builds models that generalize to new data. Data mining applies many of the same algorithms with the goal of describing patterns in existing data.
  • Data analytics: The broader practice of answering questions with data, which includes data mining along with reporting and interpretation.
  • Data visualization: Presents data and mined patterns graphically so people can read them.
  • Web scraping: Collects data from websites. Popular usage sometimes calls this data mining, but in the technical sense mining is the analysis that follows collection.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning