CPSC 4830 2025summer Lecture 2
CPSC 4830 2025summer Lecture 2
Standard deviation s (or σ) is the square root of variance s square (or σ square)
Normal Distribution properties
The normal (distribution) curve, measurements (μ: mean, σ: standard deviation)
From μ–σ to μ+σ: contains about 68% of the
From μ–2σ to μ+2σ: contains about 95% of it
From μ–3σ to μ+3σ: contains about 99.7% of it
Basic Graphs to study the attribute distribution
Boxplot: graphic display of five-number summary
Histogram: x-axis are values, y-axis represent frequencies
Quantile plot: each value xi is paired with fi indicating that approximately 100 fi % of data are ≤ xi (seldom
use this, and we directly use q-q plot)
Quantile-quantile (q-q) plot: graphs the quantiles of one univariant distribution against the corresponding
quantiles of another
Scatter plot: each pair of values is a pair of coordinates and plotted as points in the plane
Basic Graphs to study the attribute distribution
Histogram: Graph display of tabulated frequencies, shown as bars
It shows what proportion of cases fall into each of several categories
Differs from a bar chart in that it is the area of the bar that denotes the value, not the height as in bar charts,
a crucial distinction when the categories are not of uniform width
The categories are usually specified as non-overlapping intervals of some variable. The categories (bars) must
be adjacent
Basic Graphs to study the attribute distribution
Quantile plot: Displays all of the data (allowing the user to assess both the overall behavior and unusual
occurrences)
Plots quantile information
For a data xi data sorted in increasing order, fi indicates that approximately 100 fi% of the data are below or
equal to the value xi
Basic Graphs to study the attribute distribution
Q-Q Plot: Graphs the quantiles of one univariate distribution against the corresponding quantiles of another
View: Is there is a shift in going from one distribution to another?
Example shows unit price of items sold at Branch 1 vs. Branch 2 for each quantile. Unit prices of items sold at
Branch 1 tend to be lower than those at Branch 2.
Basic Graphs to study the attribute distribution
Scatter Plot: Provides a first look at bivariate data to see clusters of points, outliers, etc
Each pair of values is treated as a pair of coordinates and plotted as points in the plane
Note: the right most means they are related but not in a linear relationship
Standardization of data
Z-score:
Using mean absolute deviation is more robust than using standard deviation
Measuring Distance and Similarity
Similarity
Numerical measure of how alike two data objects are
Value is higher when objects are more alike
Often falls in the range [0,1]
Dissimilarity (e.g., distance)
Numerical measure of how different two data objects are
Lower when objects are more alike
Minimum dissimilarity is often 0
Upper limit varies
Proximity refers to a similarity or dissimilarity
Measuring Distance and Similarity
Visual Similarity
Classification
Is it a horse?
Image Retrieval
Show me pictures of horses.
Unsupervised segmentation
Which parts of the image are grass?
Measuring Distance and Similarity
Dissimilarity (e.g., distance)
Measuring Distance and Similarity
Dissimilarity (e.g., distance)
Bin-by-Bin or Pixel by Pixel
Measuring Distance and Similarity
Dissimilarity (e.g., distance)
Bin-by-Bin or Pixel by Pixel
Measuring Distance and Similarity
Dissimilarity, Difference between Distance and Divergence
Distance has to fulfill 4 laws:
1.d(x,x) = 0
2.If x<>y, d(x,y) > 0
3.d(x,y) = d(y,x)
4.d(x,z) <= d(x,y) + d(y,z) (triangle inequality)
Divergence means it cannot fulfil some of the rules above (rule 3 and 4), but can still be used to measure the
dissimilarity
Measuring Distance and Similarity
Dissimilarity (e.g., distance)
Heuristic
Minkowski-form
Weighted-Mean-Variance (WMV)
Nonparametric test statistics
χ 2 (Chi Square)
Kolmogorov-Smirnov (KS)
Cramer/von Mises (CvM)
Information-theory divergences
Kullback-Liebler (KL)
Jeffrey-divergence (JD)
Ground distance measures
Histogram intersection
Quadratic form (QF)
Earth Movers Distance (EMD)
Measuring Distance and Similarity
Minkowski-form distance Lp
Special cases:
L1: absolute, cityblock, or Manhattan distance
L2: Euclidian distance
L∞: Maximum value distance
Measuring Distance and Similarity
Minkowski-form distance Lp
map the range of each variable onto [0, 1] by replacing i-th object in the f-th variable by
f is binary or nominal:
d = 0 if same, otherwise 1
f is numeric:
Use the normalized distance
f is ordinal:
Compute ranks rif and treat zif as interval
Cosine Similarity
A document can be represented by thousands of attributes, each recording the frequency of a particular
word (such as keywords) or phrase in the document.