Chapter 2
Data Understanding
Types of data sets, data objects and attribute types, central tendency and dispersion, boxplots and histograms, and the main families of data visualisation.
From: Topic 2a - Data Understanding, Topic 2b - Attribute Types, Topic 2c - Basic Statistic, Topic 2d - Data Visualisation
Types of data sets (2a)
| Type | Examples |
|---|---|
| 1. Record | Relational data (table of records); data matrix (m rows × n numeric columns); document data (each document a term vector); transaction data (each record a set of items) |
| 2. Graph | Generic graphs, social network analysis (nodes and edges) |
| 3. Ordered | Sequences of items/events, genomic sequence data |
| 4. Spatial and image | Maps (e.g. Selangor), cancer cell images; spatio-temporal data |
Public dataset sources: UC Irvine ML Repository, University of Edinburgh datasets, Google Public Data, Kent Ridge Bio-medical, FIMI repository, bioinformatics datasets.
Data objects and attributes (2b)
- A data set is a collection of data objects and their attributes.
- A data object represents an entity; also called record, point, case, sample, entity or instance. Database rows = data objects.
- An attribute is a property or characteristic of an object; also called variable, field, characteristic or feature. Columns = attributes.
- Qualitative attributes describe (not measurable, subjective); quantitative attributes deal with numbers (measurable, objective).
| Type | Meaning | Examples |
|---|---|---|
| Nominal | Names of things; no order | States, marital status, occupation, zip codes, ID numbers, eye colour |
| Binary, symmetric | Two states, both equally important | Gender |
| Binary, asymmetric | Two states, not equally important | Medical test (positive / negative) |
| Ordinal | Values have a meaningful order or ranking | Grades (A+, A, B…), size (large, medium, small), {good, better, best} |
| Interval | Differences are meaningful (a unit exists) but no true zero | Calendar dates, temperature in °C or °F |
| Ratio | Differences and ratios are meaningful (true zero) | Temperature in Kelvin, money, counts, age, mass, length |
| Attribute | Properties | Typical operations | Allowed transformation |
|---|---|---|---|
| Nominal | Distinctness (=, ≠) | Mode, entropy, χ² test | Any permutation of values |
| Ordinal | + order (<, >) | Median, percentiles, rank correlation | Order-preserving (monotonic) change |
| Interval | + addition (+, −) | Mean, standard deviation, Pearson's correlation, t and F tests | new = a × old + b |
| Ratio | + multiplication (×, ÷), all 4 | Geometric mean, harmonic mean, percent variation | new = a × old |
- Discrete attribute: finite or countably infinite values (zip codes, counts, words in documents); usually integers. Binary attributes are a special case of discrete.
- Continuous attribute: real-number values (temperature, height, weight); usually floating-point.
Central tendency (2c)
- Mean: the average (sample mean x̄ with n values; population mean μ with N). Variants: weighted arithmetic mean; trimmed mean (chops extreme values).
- Median: a holistic measure; the middle value (odd count) or the average of the middle two (even count).
- Mode: the most frequent value. Data can be unimodal, bimodal or trimodal.
- Empirical rule for moderately skewed unimodal data: mean − mode ≈ 3 × (mean − median).
- Symmetric data: mean = median = mode. Positively skewed: mode < median < mean. Negatively skewed: mean < median < mode.
Dispersion (2c)
- Quartiles: Q1 = 25th percentile, Q3 = 75th percentile. Inter-quartile range IQR = Q3 − Q1.
- Five-number summary: min, Q1, median, Q3, max.
- Outlier: usually a value more than 1.5 × IQR above Q3 or below Q1.
- Variance and standard deviation (s for a sample, σ for a population); standard deviation is the square root of variance.
- Normal curve: μ ± σ holds about 68%, μ ± 2σ about 95%, μ ± 3σ about 99.7% of the data.
Graphic displays (2c)
| Display | What it shows |
|---|---|
| Boxplot | Five-number summary: box from Q1 to Q3 (height = IQR), median line inside, whiskers to min and max, outliers plotted individually |
| Histogram | Frequencies as adjacent bars over non-overlapping intervals. The area (not height) of a bar denotes the value, unlike a bar chart. Can reveal different distributions that share the same boxplot |
| Quantile-quantile (Q-Q) plot | Quantiles of one distribution against another, to see a shift (e.g. unit prices at Branch 1 vs Branch 2) |
| Scatter plot | Bivariate data as points; shows clusters, outliers and correlation. Lower-left to upper-right = positive correlation; upper-left to lower-right = negative |
Data visualisation (2d)
Why? Gain insight by mapping data onto graphical primitives; give a qualitative overview of large data; find patterns, trends, structure, irregularities and relationships; find regions and parameters for further analysis; give visual proof of computer representations.
| Family | Idea | Methods |
|---|---|---|
| Pixel-oriented | For m dimensions, make m windows; each record's values map to pixels whose colour reflects the value | e.g. income, credit limit, transaction volume, age windows |
| Geometric projection | Geometric transformations and projections of the data | Direct visualisation, scatterplot matrices, landscapes, projection pursuit, prosection views, hyperslice, parallel coordinates |
| Icon-based | Data values become features of icons | Chernoff faces, stick figures, shape coding, colour icons, tile bars |
| Hierarchical | Hierarchical partitioning into subspaces | Dimensional stacking, worlds-within-worlds, tree-map, cone trees, InfoCube |
| Complex data and relations | Non-numerical data such as text and social networks | Tag cloud (importance by font size/colour), Newsmap |
- Parallel coordinates: n equidistant parallel axes, one per attribute, scaled to [min, max]; each data item is a polygonal line crossing every axis.
- Chernoff faces: variables mapped to facial features (eyebrow slant, eye size, nose length…).
- Stick figures: two attributes on the axes, the rest mapped to the angle or length of limbs; look for texture patterns (e.g. census data).
- Dimensional stacking: n-D space split into stacked 2-D subspaces; important attributes on the outer levels; hard beyond nine dimensions.
- Worlds-within-worlds: the function and two most important parameters in the innermost world, others fixed (N-vision, Auto Visual).
- Tree-map: screen-filling, alternately partitions x and y by attribute values (e.g. a file system).
- InfoCube: nested semi-transparent 3-D cubes. Cone trees: 3-D, works for up to about a thousand nodes.