第二讲:多元数据的可视化 - ustcstaff.ustc.edu.cn/~zwp/teach/mva/lec2_slides.pdf ·...

48
第二讲:多元数据的可视化 张伟平 课件 http://staff.ustc.edu.cn/~zwp/

Upload: others

Post on 24-Aug-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

第二讲:多元数据的可视化

张伟平

课件 http://staff.ustc.edu.cn/~zwp/

Page 2: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

简介

1.2 多元数据的可视化 . . . . . . . . . . . . . . . 21.3 可视化技术 . . . . . . . . . . . . . . . . . . . 6

1.3.1 几何投影方法 . . . . . . . . . . . . . . 61.3.2 基于像素的可视化技术 . . . . . . . . . 291.3.3 层次化可视化技术 . . . . . . . . . . . 331.3.4 基于图标的可视化技术 . . . . . . . . . 41

Previous Next First Last Back Forward 1

Page 3: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

1.2 多元数据的可视化Motivations

• 人们相信大量的数据中隐藏着有价值的信息

• 从文字或表格中挖掘有用的信息是非常困难的. 但是人类具有强大的视觉能力, 能够迅速发现图形中的特征, 因此对数据进行有效的图示化是流行的做法

• 信息可视化是通过使用计算机图像表达数据来增强人类的识别

能力, 以发现数据中预期或未预期的特征.

• 多元数据可视化中涉及的数据集往往是高维数据, 而且数据的各变量之间具有某种相关性

• 多元数据的广泛性使得人们需要对数据分布进行整体上的认识,以及了解各属性之间的关系.

Previous Next First Last Back Forward 2

Page 4: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Challenges

• 构造一个问题的良好的可视化表示有些时候是非常困难且不明

确的.

• 映射问题: 将高维数据合适的映射到 2D 上往往比较困难. 一般来说这依赖于数据的本身结构. 而且, 将数据属性和图像元素联系起来也是需要特别注意的, 不合适的联系会对观察者造成误导.

• 维数问题: 多元数据往往数据量很大且维数较大, 因此将这种数据的所有特点在一个图中表达是很困难的, 从而对用户直观的和交互的探索数据空间带来挑战. 维数的顺序也是可视化中的重要因素.

• 设计上的权衡: 多元数据可视化总是在信息量, 简单性和精确性之间进行权衡.

Previous Next First Last Back Forward 3

Page 5: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 评价可视化工具发现的结果往往不容易: 我们事先并不知道数据中含有什么样的有用信息. 但是不管怎么样, 如果对数据一无所知, 则我们就根本没有办法评价发现的结果是否具有价值.

Previous Next First Last Back Forward 4

Page 6: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

维数• 数据中的属性个数 (number of attributes)

– 1: 一维 1D/ univariate

– 2: 二维 2D/ bivariate

– 3: 三维 3D/ trivariate

– ≥ 3: 多维 (multidimensional/hypervariate/multivariate)

• 低维与高维之间的界限是不明确的, 一般高维有 ≥ 4 变量

• 一些术语:

Dimensions 相互独立的属性 (attribute)Variables 相互关联的属性

Multidimensional 独立维的维数

multivariate 相关变量的维数

Previous Next First Last Back Forward 5

Page 7: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

1.3 可视化技术根据 Keim and Kriegel (1996, 1997), 我们将多元数据的可视化

技术分为 4 类: 几何投影方法, 基于像素 (Pixel-oriented) 的可视化技术, 层次化可视化 (Hierarchical display) 和基于图标方法 (Iconog-raphy)

1.3.1 几何投影方法

• 寻找将高维数据集在低维空间显示的有效投影和变换方法

• 将数据的属性映射到 2D 平面 (例如散点图) 或者任意的空间(例如平行坐标图)

• 这种方法有利于发现异常点和不同维数之间的相关性

• 坐标的展示顺序可能会影响我们的视觉发现.

Previous Next First Last Back Forward 6

Page 8: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 当数据量或者维数较大时可能会出现观测值或者类的重叠, 从而对视觉发现造成困难

Scatter plot

• 散点图 (scatterplot) 用来展示二元离散数据.

• 可以适当的扩展, 以显示更多的信息或者推广到 3 维数据

二维数据:

Previous Next First Last Back Forward 7

Page 9: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

2 3 4 5

1015

2025

30

Scatterplot Example

Car Weight

Mile

s P

er G

allo

n

2 3 4 5

1015

2025

30

wt

mpg

Chrysler Imperial

Toyota Corolla

Fiat 128

Previous Next First Last Back Forward 8

Page 10: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

三维数据:

45 50 55 60 65 70 75

2040

6080

100

US airpollution:temperature, SO2 and No. of manufacturing enterprise

Temp

SO2

Petal.Length

Petal.Width

Sepal.Length

Iris Datasetosaversicolorvirginica

Previous Next First Last Back Forward 9

Page 11: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Previous Next First Last Back Forward 10

Page 12: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

对 3 维以上的数据, 通过两两之间的散点图来发现变量之间的关系, 即:

Scatterplot Matrix

• 对高维数据集, 散点图阵将所有两两变量之间的散点图以矩阵形式排列展示

• 容易发现两两之间的关系, 且只能发现两个维之间的关系, 不能发现多个数据维之间的关系. 此外, 数据点过多时散点图会太过杂乱

• 关联更新 (brushing and linking) 技术可以应用到散点图中以解决上述部分问题: 被刷 (brushed) 的点在系统中所有视图中被高亮显示,这样对比不同的视图就可以从不同的侧面来看到

数据的特征.

• 在每个散点图中, 不同类别 (水平) 的点用不同的颜色来突出显

Previous Next First Last Back Forward 11

Page 13: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 下图中, 车辆数据按照缸体个数用不同的颜色突出显示.

displayed in R via the pairs() function

Previous Next First Last Back Forward 12

Page 14: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Trellis Displays(Becker and Cleveland, 1996)

• 一类基于条件化一个或者多个变量对复杂多元数据进行可视化

的技术, 常表现为一些图形构成的矩阵阵列, 因此称为 Trellis.

• 对变量的不同水平或者不同区间下的数据集绘制相同的图形 (比如直方图, 散点图等)

• 许多统计软件使用 trellis plots 或者 crossplots 这样的名称来进行多面板条件化作图

• 在 R 中使用 lattice 包来载入 trellis 系统. 可以参考 Sarkar,Deepayan (2008) Lattice: Multivariate Data Visualizationwith R. Springer, New York.

Previous Next First Last Back Forward 13

Page 15: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

long

lat

-35

-30

-25

-20

-15

-10

165 170 175 180 185

depthgroup depthgroup

165 170 175 180 185

depthgroup

depthgroup depthgroup

-35

-30

-25

-20

-15

-10depthgroup

-35

-30

-25

-20

-15

-10depthgroup

165 170 175 180 185

depthgroup• quakes 数据集, 感兴趣是三个变量 lat,long和 depth

• 图形从左到右, 从下到上,深度 (depth) 逐渐增加

• 8 个不同的深度区间, 每个包含约相同的地震次数

• 较浅的地震在两个倾斜的

断层板块上均有发生; 西边的板块主要是浅地震, 而东边的板块深浅地震都有.

Previous Next First Last Back Forward 14

Page 16: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Hyperslice(Jarke and Robert, 1993)

• 一种可视化多维标量函数的方法, 本质想法是将一个多维函数表示为一些正交二维切片 (slice) 图构成的矩阵

• 对 p 维标量函数 f(x) = f(x1, . . . , xp), 记 c = (c1, . . . , cp)

为感兴趣的 (当前) 点, ωi 表示第 i 维的宽度, 即 Ri = [ci −ωi/2, ci + ωi/2] 为感兴趣的区间

• 二维切片 Sk,l(k ̸= l) 为 f(x), xk ∈ Rk, xl ∈ Rl; 其他 xi = ci,i ̸= k, l 的表示

• 一维图 Gk 为 f(x), xk ∈ Rk, 且其他 xi = ci, i ̸= k 的图 (横轴为 xk, 纵轴为 f(x)) 的表示

• HyperSlice 图就是一个 p × p 矩阵图, 对角为一维图 Gi, 非对角元 (k, l)为二维切片图 Sk,l, 用相应于函数值大小的灰度值表示函数的值

Previous Next First Last Back Forward 15

Page 17: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• p = 3 的 HyperSlice 示意图: 左边为当前点及其邻域, 右边为相应的 HyperSlice 图Figures

Figure 1. The concept of HyperSlice for N = 3

x1 x2 x3 x4 x5

x1

x2

x3

x4

x5

Figure 2. E�ect of dragging a slice157

• 当我们拖动切片 Sk,l 位移 [dk, dl] 时, 当前点从 c 变为

ck − dk → ck, cl − dl → cl

此时的效果图如下 (S4,2 被拖动, 同一列的切片图水平移动 dk,同一行的垂直移动 dl)

Previous Next First Last Back Forward 16

Page 18: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Figures

Figure 1. The concept of HyperSlice for N = 3

x1 x2 x3 x4 x5

x1

x2

x3

x4

x5

Figure 2. E�ect of dragging a slice157

Hyperbox (Alpern and Carter, 1991)

• 类似于前面的散点图阵和 HyperSlice, 不同之处在于使用 p 维

盒子来建立图形, 而不是散点矩

Previous Next First Last Back Forward 17

Page 19: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• Hyperbox 是 p 维盒子的二维描述, 下面是一个 5 维 hyperbox图

• 一个 p 维 hyperbox 由 p2 个线和 p(p− 1)/2 个面构成, 线的长度和斜率可以是任意值

• 同样长度和方向的线构成方向集 (direction set). 上图中, 线1,2,3,4,5 构成一个方向集, 线 I, II, III, IV, V 构成另外一个方

Previous Next First Last Back Forward 18

Page 20: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

向集.

• 给定 5 个变量 x, y, z, ω 和 u, 每个变量映射到一个方向, 如上右图所示

• 每个面可以用来绘制两个变量之间的散点图或者其他线图

• Hyperbox比散点图阵功能要强大的多,它可以将变量映射到面的大小和形状, 可以强调或者不强调某些变量

• p 维数据映射到 2 维, 长度和方向的任意性可能会导致错误的信息

Previous Next First Last Back Forward 19

Page 21: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Parallel Coordinates(Inselberg and Dimsdale, 1990)

• 平行坐标图 (Parallel Coordinates) 是最早提出的以二维形式表示 p 维空间数据的可视化技术之一

• 基本思想是将 p 维数据用 p 条等距离的平行轴映射到二维平面

上, 每条轴线代表一个属性维

11

3.2.4 Hyberbox

Hyperbox [25] works similarly with the above techniques, except that the plots are now

constructed as n-dimensional box instead of a matrix, as shown in Figure 3.5. The box is

depicted in two dimensional because it is impossible to model the box exactly in an

n-dimensional space. Hyberbox is a more powerful tool as it is possible to map variables to

both size and shape of the face. It also allows emphasizing or de-emphasizing some variables

[23]. However, the length and orientation are arbitrary which may convey the wrong

information as it violates the “banking to 45 degrees” principle [26].

Figure 3.5: (a) A hyberbox [23]. Figure 3.6: Parallel coordinates [17].

3.2.5 Parallel Coordinates

Parallel coordinates [27] [28] [29] is a well-know technique where attributes are represented

by parallel vertical axes linearly scaled within their data range. Each data item is represented

by a polygonal line that intersects each axis at respective attribute data value, see Figure 3.6.

Parallel coordinates can be used to study the correlations among attributes by spotting

the locations of the intersection points [23]. Also, they are effective for revealing the data

distributions and functional dependencies. Nevertheless, one major limitation is the limited

space available for each parallel axis. Visual clutter can severely hamper the user’s ability to

interpret and interact with the visualizations [11]. Similar problem arises when the

dimensionality of the data is too high that the axes are packed very closely. Same as the

previous techniques, brushing may be applied to aid interpretation.

Circular Parallel Coordinates [30] is one of the variations adopting a radial arrangement

of the axes, as illustrated in Figure 3.7. Hierarchical Parallel Coordinates [31] is an extension

that targets at large datasets. It displays the aggregation information derived from a

hierarchical clustering of the data [11]. These clusters are displayed at different levels of

abstraction with proximity-based coloring and structure-based brushing [32], see Figure 3.8.

Previous Next First Last Back Forward 20

Page 22: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 优点是表达数据关系非常直观, 易于理解

• 缺点是维数非常大时垂直轴非常靠近. 数据个数非常大时的重叠会掩盖数据属性的内容关系. 此外, 垂直平行轴之间的安排顺序对发现数据之间关系有着重要影响

• 层次平行坐标图可以解决数据重叠所带来的问题

Figure 4: This image sequence shows a Fatal Accident data set of 230,000 data elements at different level of details. The first image shows acut across the root node. The last image shows the cut chaining all the leaf nodes. The rest of the images show intermediate cuts at varyinglevels-of-detail. (See Color Plates).

Figure 6: Left image shows Iris data set without proximity-based coloring. Right image shows Iris data set with proximity-based coloringrevealing three distinct clusters depicted by concentrations of blue, green and pink lines. (See Color Plates).

230,000 个严重事故数据.第一个图为聚类根节点水平下, 最后一个为所有数据点下. 中间为不同聚类层次下.

Previous Next First Last Back Forward 21

Page 23: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Survey plot

• 使用等距平行线表示坐标轴,所有数据点按照某个属性排序

后, 将每个数据点的每个属性值通过从相应坐标上延伸出的

线表示, 线长与该属性值成比例.

• 有助于发现两个变量之间的相

关性

• 对 不 同 的 类 使 用 不 同 的

颜 色 有 助 于 寻 找 能 够

最 佳 分 类 数 据 的 坐 标Survey Plot for Iris

Features

Sepal.Length

Sepal.Width

Petal.Length

Petal.Width

Previous Next First Last Back Forward 22

Page 24: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Andrews Curve(Andrews, 1972)

• 使用一条光滑的曲线表示每个 p 元观测点 x = (x1, . . . , xp):p 为奇数时

f(t) =x1√2+x2sin(t)+x3cos(t)+. . .+xp−1sin(

p− 1

2t)+xpcos(

p− 1

2t)

p 为偶数时

f(t) =x1√2+ x2sin(t) + x3cos(t) + . . .+ xpsin(

p

2t)

其中 −π < t < π

• 相近点的曲线表示也类似, 不同点的曲线表示也不同. 因而方便用于发现类和异常点.

Previous Next First Last Back Forward 23

Page 25: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Type = 4

−3 −2 −1 0 1 2 3

−2

−1

01

2

Star Coordinates(Kandogan, 2000)

• 散点图往高维的一种推广

• 对 p 维数据, 使用 p 条半径将圆均分, p 条半径作为坐标轴, 再将原数据点映射到以 p 条半径为坐标轴的圆上. 进而还可以对坐标轴进行旋转和变换. 例如下图所示

Previous Next First Last Back Forward 24

Page 26: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Users can also select value ranges on one or more axes and mark the corresponding data points in the visualization. This operation allows users to understand how particular factors play a role in the distribution of data.

3. Applications Star Coordinates has been evaluated on a number of

real datasets. It has been found to be particularly useful in gaining insight into hierarchically clustered datasets. Figure 2 shows an example dataset that contains car specs (e.g. mpg, cylinders, weight, acceleration, displacement, origin, horsepower, year, etc.) on approximately 400 cars manufactured world-wide. After playing (scaling, rotating, turning off some coordinates) for a while with the “cars” dataset the user easily discovers that there are 4 major clusters in the data as shown in the top of the figure.

Figure 2. Cluster analysis on car specs.

Scaling the “origin” coordinate moves only the top two clusters, which indicates that these clusters represent the origin of the cars, specifically European and Japanese cars. Down-scaling the origin further reveals that these two clusters join one of the other clusters (American-made cars of similar specs.) forming a new cluster, which can be identified as low weight, low displacement, high acceleration cars. The remaining cluster thus represents American-made heavy, low

acceleration, high displacement cars. Within few minutes users can identify how the data is clustered and gain an understanding of the basic characteristics of these clusters.

Figure 3. Multi-factor analysis on city criteria.

Another application where Star Coordinates proved useful is multi-factor analysis for decision-making. The example in this case is the “places” dataset, which contains ratings of major American cities with regards to a number of criteria such as climate, transportation, housing, education, arts, recreation, crime, health-care, and economics. The user arranges the coordinates in such a way that the coordinates for important desirable factors are pulled together in one direction and negative factors in the opposite direction. In the example in Figure 3, recreation, arts, education are grouped together with about the same importance (i.e. scaling factor). Climate is given special attention by increasing its scaling factor, yet it is made almost perpendicular to the other factors. This makes it easier to distinguish points with regards to the effect of the climate. Crime on the other hand is arranged so that it points almost in the

• 数据中相近的点变换到圆上也很相近, 因此利用发现数据中的类

Previous Next First Last Back Forward 25

Page 27: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Radiz or Radial Visualization Plots(Hoffman, 1999)

• 径向可视化图的想法是利用弹簧常数来表示数据点之间的相关

• 对 p 维数据, 选择 p 个点等距散布在圆周上 (这些点称为固定点), 每个固定点连接一个弹簧的一头, 弹簧的另一个头链接到一个点 (该点为映射后的点), 该点的 p 个弹簧力和为 0

• 弹簧常数 Ki 等于数据点的第 i 个坐标值

• 所有的数据点一般需要通过正则化映射到 0 到 1 之间. 当一个数据点的所有 p个坐标值都相同时,映射点将为圆心; 如果数据点为单位向量, 则恰好映射到圆边上的固定点. 多个数据点可以映射到同一个点.

• 这种方法是数据的一个非线性映射, 其保持了某种对称性. 各坐标近似相同的数据点被映射后靠近圆心; 具有类似值但是坐

Previous Next First Last Back Forward 26

Page 28: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

标方向相互相反的点映射后也靠近圆心

• p 维直线映射成一条线; 一个球映射为一个椭圆; p 维平面映射为一个有界多边形

Sepal.Length

Sepal.Width

Petal.Length

Petal.Width

setosa versicolor virginica

2D-Radviz for

Previous Next First Last Back Forward 27

Page 29: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

几何投影方法总结• 可以处理大的或者非常大的数据集, 但是对大的数据集可能会出现点或者类的重叠

• 可以合理的处理中高维数据集

• 所有变量同等对待, 轴的顺序对图形的形状进而可视化发现结果具有影响

• 能够有效发现异常点和不同变量之间的相关性等

Previous Next First Last Back Forward 28

Page 30: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

1.3.2 基于像素的可视化技术

• 用一个像素的颜色来表示一个数值的大小

• 对 n个 p维数据点集,在屏幕上创建 p个窗口,每一维一个. 数据集的每一维值大小通过一个窗口的 n 个像素颜色来表示

• 在窗口内,数据值按所有窗口共用的某种全局序安排. 据此可分为查询相关 (query-dependent)和查询无关 (query-independent)两种

• 查询相关就是给定一个点, 按照所有数据点与该点的相似度排序; 查询无关则是按照数据的某个维自然顺序排列.

• 适用于数据量巨大场合, 利用发现变量之间的关系, 趋势等.

• 对理解数据在多维空间里的分布帮助不大, 例如并不能显示多维子空间是否存在稠密区域.

Previous Next First Last Back Forward 29

Page 31: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 一家电子商务网站的顾客信息表,包含 4个维: income, credit_limit,transaction_volume 和 age, 则可通过基于像素的可视化技术发现 income 和其他变量之间的相关性 (值越小, 颜色越淡):

– credit_limit 随 income 增加而增加

– 收入处于中部区间的顾客更可能从该电子商购物

– income 和 age 没有明显的相关性

• 当窗口过宽时, 以线性方法安排数据记录填充窗口的效果可能不好. 每行的第一个像素与前一行的最后一个像素离得太远,

Previous Next First Last Back Forward 30

Page 32: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

尽管它们的对象在全局序下是彼此贴近的. 此外, 像素与它上面的像素相邻, 但这两个像素的对象在全局序下并非彼此相邻.

• 为此, 使用空间填充曲线 (space-filling curve) 来安排数据记录填充窗口 (图 c 和 d)

- 5 -

2. Query-Independent Visualization Techniques

As already mentioned, the basic idea of our visualization techniques is to present as many data

values as possible at the same time with the number of data values being only limited by the number

of pixels of the display. In dealing with arbitrary multivariate data without any 2D- or 3D-semantics,

one major problem is to find meaningful arrangements of the pixels on the screen. Even if the data

has a natural ordering according to one variable (e.g., time series data), there are many possibilities

for arranging the data. One straightforward possibility is to arrange the data items from left to right

in a line-by-line fashion (cf. Figure 2a). Another possibility is to arrange the data items top-down

in a column-by-column fashion (cf. Figure 2b). If these arrangements are done pixelwise, in

general, the resulting visualizations do not provide useful results. More useful are techniques which

provide a better clustering of closely related data items and allow the user to influence the

arrangement of the data. Techniques with nice clustering properties are screen-filling curves (cf.

section 2.1). A technique which provides nice clustering properties as well as user influence on the

arrangement is the recursive pattern technique (cf. section 2.2).

2.1 Screen-filling Curve Techniques: Peano-Hilbert Curve and Morton Curve

The screen-filling curves techniques are based on the well-known space-filling curve

algorithms by Peano & Hilbert [Pea 90, Hil 91] and Morton [Mor 66]. The basic idea of space-

filling curves is to provide a continuous curve which passes through every point of a regular spatial

region (e.g., a square). For a long time, the space-filling curve algorithms were mainly used for

studying recursion and for producing pretty pictures. Two decades ago, researchers started to use

the spatial clustering properties of space-filling curves for indexing spatial databases [AG 80]. The

basic idea is to optimize storage and processing of two-dimensional data by mapping them into one

dimension. Space-filling curves provide a mapping which preserves the spatial locality of the

original two-dimensional image. In visualizing multivariate data which is sorted according to one

dimension, we have the opposite problem namely mapping a one-dimensional distribution of data

Figure 2: Data Arrangements

a. line-by-line b. column-by-column c. Peano-Hilbert d. Morton

• 窗口也不必是矩形的. 例如:

Previous Next First Last Back Forward 31

Page 33: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

基于像素的可视化技术总结• 在高解析度的显示器上可以处理大规模以及非常大规模的数据

• 可以合理的处理中高维数据集

• 每个数据点被唯一的映射到一个像素, 因此不会出现点或者类的重叠现象

Previous Next First Last Back Forward 32

Page 34: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

1.3.3 层次化可视化技术

对大维数据集, 很难同时对所有维可视化. 层次化技术将所有维划分为子集 (即子空间), 这些子空间按层次可视化, 从而将所有维数展示出来.Dimensional Stacking(Leblance et al., 1990)

• 将 p 维数据空间划分为嵌套堆栈的 2 维子空间

• 适用于每一维具有有序低势 (不同可能值的个数) 的低维数据集 (一般 p ≤ 20)

• 过程:

– 选择两个最重要的变量 xi 和 xj , 根据它们的势定义 2 维格子

– 在剩余的变量中再选择两个最重要的变量, 根据其势将每个格子划分为更小的格子, 重复直至所有变量被表示 (奇

Previous Next First Last Back Forward 33

Page 35: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

数个变量时候引入哑变量)

– 使用颜色标出数据点所处的格子 (颜色可以依据变量的值, 或者格子内数据的頻数)

例如对四个变量:变量 最小值 最大值 势

研究生 0 10 4教师 0 20 4助教 0 10 4助研 0 10 4

颜色强调的格子表示: 研究生 (2.5-5.0,最外层,水平方向);教师 (15.0-20.0, 最外层, 垂直方向); 助教 (0.0-2.5, 内层, 水平方向); 助研 (5.0-7.5, 内层, 垂直方向).

Previous Next First Last Back Forward 34

Page 36: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Mosaic Plot(Friendly, 1994)• 一种公认的用于属性数据的可视化方法

• 在 m 维列联表中通过嵌套的矩形表示数据的頻数

– 矩形的面积与数据的頻数成比例

• 过程:

– 首先将一个正方形在水平方向上按照变量 X1 的边际总数

成比例的分割成矩形

– 对 X1 的每个类别, 在垂直方向上按照 X2 的条件频率成

比例分割该矩形

– 然后, X1 和 X2 的每个类别组合的矩形按照 X3 的条件

频率成比例分割

– 重复以上过程, 直至所有变量都已经包含在图中

Previous Next First Last Back Forward 35

Page 37: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Survival on the Titanic

Class

Sex

1st 2nd 3rd Crew

Male

Female

Child Adult

No

Yes

No

Yes

Child Adult Child Adult Child Adult

Previous Next First Last Back Forward 36

Page 38: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Worlds-within-worlds(Feiner and Beshers, 1990)• “世界中的世界 (Worlds-within-worlds)” 又称 n-Vision, 是一种代表性的层次 (动态) 可视化方法.

18

3.4.2 Dimensional Stacking

Dimensional stacking [48], also called general logic diagrams, is a variation of hierarchical

axis [23]. It partitions the data space into 2-dimensional subspaces which are stacked into

each other [15], as depicted in Figure 3.18. Those important attributes should be chosen for

the outer levels. This technique is especially adequate for discrete categorical or binned

ordinal values. A major advantage of dimensional stacking over hierarchical axis is that no

aggregation function is needed to plot the data, such as the previous case of histogram [23].

(a)

(b)

Figure 3.18: (a) Partition of dimensional stacking, (b) An example [15].

3.4.3 Worlds Within Worlds

Another well-know hierarchical technique is worlds within world, or n-vision [49]. The data

space is now subdivided into 3-dimenstional subspaces. It generates an interactive hierarchy

display, instead of the static objects in the previous one, by using powerful 3D rendering [23].

It allows the exploration of n-dimensional function spaces, but could also be adapted to

n-dimensional datasets [30]. Figure 3.19 shows an example that encodes 5-dimenisonal data.

Figure 3.19: N-Vision [50]. Figure 3.20: Treemap [52].

例如对 6维点 (f, x1, x2, x3, x4, x5),感兴趣是 f 维如何随其他维变

化. 我们先将 x3, x4, x5 固定

在某选定的值, 比如 c3, c4, c5.然后使用 3D 图对 (f, x1, x2)

可视化 (内世界). 如左图所示.

• 内世界的原点位于外世界的点 (c3, c4, c5) 处. 外世界是另外一个三维图, 使用维 x3, x4, x5.

• 用户可以在外世界中交互地改变内世界原点的位置, 然后观察

Previous Next First Last Back Forward 37

Page 39: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

内世界的变化结果. 此外, 也可以改变内外世界使用的维.

• 给定更多维, 可以使用更多的世界层

Treemap(Shneiderman, 1992)

• 树图也是一种流行的层次化可视化技术, 它把层次数据显示成嵌套矩形的集合.

• 下图是一个 Google 新闻的树图, 所有的新闻报道被分为 7 个类, 每个显示在一个唯一颜色的矩形中, 每个矩形的大小和不同媒体的新闻报道文章数成正比.

• 在每个类别内, 新闻报道进一步分成较小的子类.

• 用户能够快速识别那类新闻是 “最热” 的 (报道最多的).http://newsmap.jp/

Previous Next First Last Back Forward 38

Page 40: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Previous Next First Last Back Forward 39

Page 41: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

层次化可视化技术总结• 可以处理小规模以及中等规模的数据集

• 更适宜处理低维至中维的数据集

• 变量被不同对待, 不同的映射得到数据的不同可视化

• 可视化结果的解释需要经过训练

Previous Next First Last Back Forward 40

Page 42: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

1.3.4 基于图标的可视化技术

• 基于图标 (icon-based) 可视化技术将多维数据点映射到一个图标 (icon/glyph).

• 一个图标总是由多个图形参数决定, 因此可以用来表示多维数据.

• 数据点的所有维没有等同对待, 因为在图标中图形元素不是同等重要突出的. 人对图形的认知差异在解释结果时导致偏差.

• 类似的数据点映射成图标后性状也类似, 因此利于发现数据中的类和趋势.

Chernoff faces(Chernoff,1973)

• 统计学家 Herman Chernoff 于 1973 年引入. 有助于发现数据中的趋势和类.

Previous Next First Last Back Forward 41

Page 43: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

• 能够将多达 18 个变量 (维) 的多维数据以卡通人脸显示.

脸的要素, 如眼、耳、口、鼻等用其形状、大小、位置和方向

表示维的值。例如,维可以映

射到如下面部特征:眼的大小、

两眼的距离、鼻子长度、鼻子宽

度、嘴巴曲度、嘴巴宽度、嘴巴

阔度、眼球大小、眉毛倾斜、眼

睛偏离程度和头部偏离程度。

19

3.4.4 Treemap

Treemap [51], as shown in Figure 3.20, uses a hierarchical partitioning of the screen into

regions, depending on the attribute values. The sizes of the nested rectangles represent the

attribute values, which provide extra information over simple mapping of dimensions only.

The color of the regions may encode an additional attribute. Treemap is suitable to obtain an

overview on large datasets with multiple ordinal attributes [15]. Moreover, it subdivides the

display in a space-filling manner that fully utilizes the available display space [53].

3.5 Iconography

Iconographic or icon-based techniques map each multidimensional data item to an icon, or

more specifically a glyph. The visual features vary depending on the data attribute values [11].

Several graphical parameters are usually contained in an icon, which makes it possible to

handle multidimensional data. Besides, observations of graphical features are pre-attentive

which is welcomed by human. However, unlike geometric techniques that treat all the

dimensions equally, some features in glyphs are more salient than others [11], adjacent

elements are easier to be related and accuracy of perceiving different graphical attributes

varies between humans tremendously. It thereby introduces biases in interpreting the result.

3.5.1 Chernoff Faces

Chernoff face visualization [54] is probably the most famous in iconography. Two attributes

are mapped to the 2D position of a face and remaining attributes are mapped to its properties

of the face, for instance, the shape of nose, mouth, eyes and that of the face itself, as

illustrated in Figure 3.21. One of the shortcomings is that different visual features are not

quite comparable to each other [11]. It is also suggested that Chernoff faces can only visualize

a limited amount of data items [14]. One common issue to all multidimensional icons,

including Chernoff faces, is that the semantic relation to the task has significant impact on the

perceptive effectiveness [2]. Yet it will then very much depend on the application domain.

(a)

(b)

Figure 3.21: (a) Chernoff faces in various 2D positions [54], (b) Different facial features [55].

• 已经发现, 眼睛大小和眉毛的歪斜是重要的.

• 脸具有垂直(关于 y轴)对称性,因此脸的左右两边是相同的. 非对称的切尔诺夫脸使面部特征加倍, 这样允许显示多达 36 维.

Previous Next First Last Back Forward 42

Page 44: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Star glyph(Chambers et al. 1983)

• 星形图是许多使用符号 (glyph) 可视化技术中最流行的一种.

• 对 p 维数据, 通过从圆心引出的 p 条等距射线来表示, 这些射线的长度代表变量的数值, 以直线链接射线的端点即构成一个星图.

20

3.5.2 Star Glyph

There are many variants in the glyph family for displaying multidimensional data; star plot

[56] is one of the most widely used glyphs. The dimensions are represented as equal angular

axes radiating from the center of a circle [30], with an outer line connecting the data value

points on each axis, as depicted in Figure 3.22(b). Each data item is presented by one star

glyph. They are helpful for multivariate datasets of moderate size, but their primary weakness

is that the display becomes overwhelming when the number of data items increases. Star plots

can be further combined with other glyphs to encode extra information, an example

incorporating the traditional box-and-whisker plots is shown in Figure 3.22(c).

(a)

(b)

(c)

Figure 3.22: (a) Construct a star plot [57], (b) Group of star glyphs [30], (c) Box plot stars [58].

3.5.3 Stick Figure

Stick figure [59] is another classical icon-based technique that again maps two attributes to

the display axes and the remaining to the rotation angle, length, thickness or color of the

limbs, as depicted in Figure 3.23(a). When the data items are relatively dense with respect to

the display dimensions, the packed icons exhibit some texture patterns that vary according to

the data features, which are detected by pre-attentive perception [14]. However, the visual

discernment of an important pattern is highly dependent upon the selection of an appropriate

graphical attribute. This selection process is therefore deterministic and can a bottleneck [23].

• 每个数据点由一个星形图表示. 这样, 当数据点个数很大时, 同时可视化所有数据点来发现模式将变的不可能.

Previous Next First Last Back Forward 43

Page 45: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

Stick figure(Pickett and Grinstein, 1988)

• 人物线条画 (stick figure) 可视化技术把多维数据映射到 5-段人物线条画, 其中每个画都有四肢和一个躯体. 两个维被映射到显示轴 (x 和 y 轴),而其余的维映射到四肢角度和 (或) 长度 (下图 a)

• 如果数据项关于两个显示维相对稠密, 则结果可视化显示纹理模式, 反映数据趋势.

• 下图 b 为用人物线条画表示的人口统计数据.

Previous Next First Last Back Forward 44

Page 46: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

21

(a)

(b)

(c)

Figure 3.23: (a) Stick figure family [23], (b) 5D image data using stick figures,

(c) Part of (b) in original size [60].

3.5.4 Shape Coding

Shape coding [61] visualizes data using small arrays of pixels. Each data item is represented

by one such array, and the pixels are mapped to a color scale according to the attribute values,

see Figure 3.24. Pixels in the array are placed in the form of square or rectangle and the arrays

are arranged successively in a line-by-line fashion [14]. These arrays can contain an arbitrary

number of pixels, making it possible for multidimensional data visualization.

(a)

(b)

Figure 3.24: (a) Shape coding array [15], (b) An example [61].

3.5.5 Color Icon

Color icon [62] is a combination of the pixel-based spiral axes and icon-based shape coding

techniques. Pixels are replaced by arrays of color fields that represent the attribute values

similar to shape coding, as illustrated in Figure 3.25(c). Color, shape, size, orientation,

boundaries and area sub-dividers can all be used to map the multidimensional data [23]. Color

icon therefore merges color, shape and texture perception for iconographic integration [62].

Previous Next First Last Back Forward 45

Page 47: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

基于图标的可视化技术总结• 能够处理小规模到中等规模的数据集

• 可以用于高维数据集, 但是结果解释不直接, 需要一定的训练

• 变量被不同对待, 因为图标的一些特征比其他的更令人注意

– 数据变量被映射到图标特征的方式严重决定了可视化的表达力以及感知力

• 定义合适的映射可能比较困难, 特别是更高维的数据

• 当一些变量映射到显示位置时, 数据点可能会重叠

Previous Next First Last Back Forward 46

Page 48: 第二讲:多元数据的可视化 - USTCstaff.ustc.edu.cn/~zwp/teach/MVA/Lec2_slides.pdf · 形式排列展示 • 容易发现两两之间的关系, 且只能发现两个维之间的关系,

最后

A picture is worth a thousand words

Previous Next First Last Back Forward 47