Skip to main content

Discrete vs continuous attributes

Short answer

Discrete attributes take finite/countable values (integers, categories), obtained by counting. Continuous attributes take real values in a range, obtained by measuring. Discrete examples: number of students, zip code; continuous: height, weight, temperature. Discrete uses bar charts; continuous uses histograms. Continuous can be discretized for some algorithms.

Differentiate discrete and continuous attributes with examples.

A discrete attribute takes a finite or countably infinite set of values, often integers. A continuous attribute takes real values within a range and can have any number of decimal places.

BasisDiscreteContinuous
ValuesFinite or countable setInfinite, any value in an interval
Obtained byCountingMeasuring
RepresentationIntegers, categories, binary 0/1Floating-point numbers
Gap between valuesDistinct gapsNo gaps; can be divided further
ExamplesNumber of students, zip code, set of words, yes/no, genderHeight, weight, temperature, time, distance
Typical graphBar chartHistogram, line graph
Mining useUsed directly by counting methods (Apriori, Naive Bayes)Often discretized for tree/association algorithms; distance measures work directly

Notes

  • Binary attributes (0/1, true/false) are a special case of discrete attributes.
  • Continuous values are stored with limited precision in a computer, so in practice they are represented as floating-point numbers.
  • A continuous attribute can be converted to discrete by discretization (e.g. marks 0-100 to grades A-F); a discrete one can be treated as continuous when it has many ordered values (e.g. salary in rupees).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Mining chapter 2 questions →