---
title: "Data discretization"
subject: "Data Mining"
chapter: 2
key: "semester_7/data_mining:data-discretization"
source: https://www.bctengineer.com/q/semester_7/data_mining/data-discretization
site: BCT Engineering
---

# Data discretization

Data Mining · Chapter 2: Data Pre-processing

- Asked in: year not given
- Video: [Lec -10 : Introduction to Data Discretization with example](https://www.youtube.com/watch?v=bb72oxHgOHw) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/data-discretization
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-2

## Question

Describe briefly about Data Discretization and how it can be achieved.

## Short answer

Discretization divides numeric values into intervals (e.g., equal-width, equal-frequency binning) or uses supervised methods like entropy-based splitting. It reduces data size and supports algorithms requiring categorical input, at the cost of some information loss.

## Answer

**Data discretization** transforms a continuous (numeric) attribute into a finite number of intervals or categorical labels, and the interval labels replace the actual values. It reduces data size, makes data easier to understand, and is needed by algorithms that accept only categorical input (e.g. Apriori, ID3, Naive Bayes). *Example*: age 0-18 → "youth", 19-59 → "adult", 60+ → "senior". A concept hierarchy is built when the labels are generalised further.

#### Techniques
**Unsupervised (ignore class label)**
- **Equal-width binning**: divide the range into k intervals of equal width w = (max − min)/k. Simple but sensitive to outliers.
- **Equal-frequency (equal-depth) binning**: each bin has roughly the same number of values. Good for skewed data.
- **Clustering**: group values by k-means and use cluster boundaries.

**Supervised (use class label)**
- **Entropy-based (decision-tree) discretization**: choose the split point that gives the highest information gain, then split recursively.
- **ChiMerge**: bottom-up, merge adjacent intervals that have similar class distribution using χ² test.

**Other**
- **Histogram analysis** and **concept hierarchy generation** (natural hierarchy such as day → month → year).

*Example (equal-depth)*: prices 4, 8, 15, 21, 21, 24, 25, 28, 34 → Bin 1 (4, 8, 15), Bin 2 (21, 21, 24), Bin 3 (25, 28, 34).

Discretization loses some information, so the number of intervals should be chosen carefully.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does discretization do?
   A. Turns categories into numbers
   B. Transforms a continuous attribute into a finite number of intervals or labels
   C. Fills missing values
   D. Fits a hyperplane
   Answer: B. Labels replace actual values, e.g. age 0-18 as youth. (Key point: Definition)

2. How is the width computed in equal-width binning with k intervals?
   A. w = max/k
   B. w = n/k
   C. w = (max - min)/k
   D. w = (max + min)/k
   Answer: C. The range is divided into k equal intervals; it is sensitive to outliers. (Key point: Equal-width)

3. When is equal-frequency binning preferred?
   A. For data with identical widths
   B. When class labels are known
   C. Only for nominal data
   D. For skewed data, since each bin gets roughly the same number of values
   Answer: D. Equal-depth avoids bins with almost all values. (Key point: Equal-frequency)

4. Which is a supervised discretization method?
   A. Entropy-based splitting or ChiMerge
   B. Equal-width binning
   C. Equal-frequency binning
   D. Min-max normalisation
   Answer: A. Supervised methods use class labels; ChiMerge merges adjacent intervals with similar class distribution. (Key point: Supervised methods)
