Data ch2
Data ch2
— Chapter 2 —
Data Visualization
Summary
2
Types of Data Sets
Record
Relational records
Data matrix, e.g., numerical matrix,
timeout
season
coach
game
score
team
ball
lost
pla
wi
crosstabs
n
y
Document data: text documents: term-
frequency vector
Document 1 3 0 5 0 2 6 0 2 0 2
Transaction data
Graph and network Document 2 0 7 0 2 1 0 0 3 0 0
Dimensionality
Curse of dimensionality
Sparsity
Only presence counts
Resolution
Patterns depend on the scale
Distribution
Centrality and dispersion
4
Data Objects
Binary
Numeric: quantitative
Interval-scaled
Ratio-scaled
6
Attribute Types
Nominal: categories, states, or “names of things”
Hair_color = {auburn, black, blond, brown, grey, red, white}
marital status, occupation, ID numbers, zip codes
Binary
Nominal attribute with only 2 states (0 and 1)
Symmetric binary: both outcomes equally important
e.g., gender
Asymmetric binary: outcomes not equally important.
e.g., medical test (positive vs. negative)
Convention: assign 1 to most important outcome (e.g., HIV
positive)
Ordinal
Values have a meaningful order (ranking) but magnitude between
successive values is not known.
Size = {small, medium, large}, grades, army rankings
7
Numeric Attribute Types
Quantity (integer or real-valued)
Interval
Measured on a scale of equal-sized units
Values have order
E.g., temperature in C˚or F˚, calendar dates
No true zero-point
Ratio
Inherent zero-point
We can speak of values as being an order of
magnitude larger than the unit of measurement
(10 K˚ is twice as high as 5 K˚).
e.g., temperature in Kelvin, length, counts,
monetary quantities
8
Discrete vs. Continuous Attributes
Discrete Attribute
Has only a finite or countably infinite set of values
collection of documents
Sometimes, represented as integer variables
attributes
Continuous Attribute
Has real numbers as attribute values
floating-point variables
9
Chapter 2: Getting to Know Your Data
Data Visualization
Summary
10
Basic Statistical Descriptions of Data
Motivation
To better understand the data: central tendency,
variation and spread
Data dispersion characteristics
median, max, min, quantiles, outliers, variance, etc.
Numerical dimensions correspond to sorted intervals
Data dispersion: analyzed with multiple granularities
of precision
Boxplot or quantile analysis on sorted intervals
Dispersion analysis on computed measures
Folding measures into numerical dimensions
Boxplot or quantile analysis on the transformed cube
11
Basic Statistical Descriptions of Data
For data preprocessing to be successful, it is essential to
have an overall picture of your data.
Basic statistical descriptions can be used to identify
properties of the data
highlight noise or outliers
Three areas of basic statistical descriptions.
Measures of Central Tendency: Middle or center of a data
distribution. (where do most of its values fall) e.g. mean,
median, mode.
Dispersion of the data: how are the data spread out? (range,
quartiles, boxplots; and the variance and standard deviation of the data )
Graphic displays of basic statistical descriptions: to visually
inspect our data. (bar charts, pie charts, and line graphs, histograms,
and scatter plots etc.)
12
Measuring the Central Tendency
Mean (algebraic measure) (sample vs. population): 1 n
x xi x
Note: n is sample size and N is population size. n i 1 N
13
Measuring the Central Tendency
Issues: A major problem with the mean is its sensitivity to extreme (e.g.,
outlier) values.
For example, the mean salary at a company may be substantially pushed up
by that of a few highly paid managers.
Similarly, the mean score of a class in an exam could be pulled down quite a
bit by a few very low scores.
Trimmed mean: Mean obtained after chopping off values at the high and low
extremes, to offset the effect caused by a small number of extreme values.
For example, we can sort the values observed for salary and remove the top
and bottom 2% before computing the mean.
We should avoid trimming too large a portion (such as 20%) at both ends,
as this can result in the loss of valuable information
14
Measuring the Central Tendency
Median:
Middle value if odd number of values, or average of
the middle two values otherwise
Estimated by interpolation (for grouped data)
The mode for a set of data is the value that occurs
most frequently in the set
Mode
Value that occurs most frequently in the data
Unimodal, bimodal, trimodal
A data set with two or more modes is multimodal
At the other extreme, if each data value occurs only
once, then there is no mode
15
Symmetric vs. Skewed Data
Median, mean and mode of symmetric, symmetric
positively and negatively skewed data