an alternative arrangement of symmetric datasets for vertical clustering algorithms

19
An Alternative Arrangement of An Alternative Arrangement of Symmetric Datasets for Vertical Symmetric Datasets for Vertical Clustering Algorithms Clustering Algorithms

Upload: carol-jordan

Post on 28-Dec-2015

227 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

An Alternative Arrangement of An Alternative Arrangement of Symmetric Datasets for Vertical Symmetric Datasets for Vertical

Clustering AlgorithmsClustering Algorithms

Page 2: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

2

OutlineOutline

Symmetric datasets and application

Problems for n x n symmetric datasets

Proposed solutions

Performance evaluation

Summary

Page 3: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

3

Symmetric Symmetric DatasetDataset

A symmetric dataset is an n x n dataset that when transposed, is the same (a undirected unipartite graph).

The dataset may record precomputed information such as– pair-wise similarity (of genes?)– pair-wise Euclidian distance (of objects?)which are "edge labels" when viewing the data as a graph.

Examples of algorithms that use symmetric datasets:– clustering Microarray Data based on Density– Shared NN and Vertical Density-based Clustering Algorithms.

Page 4: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

4

Symmetric Symmetric DatasetDataset

Example of a symmetric dataset: the pre-computed pair-wise similarity of

genes:

could be, e.g., the Pearson’s correlation coefficient of expression vectors

(see http://davidmlane.com/hyperstat/A51911.html orhttp://en.wikipedia.org/wiki/Correlation#Pearson.27s_product-moment_coefficient )

516516251615160516

5162221202

5161211101

5160201000

,,,,

,,,,

,,,,

,,,,

gggggggg

gggggggg

gggggggg

gggggggg

Page 5: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

5

Pearson's correlation coefficient example

A commonly used formula is

X Y 1 2 2 5 3 6 scalar product

L1 or Manhattan vector length

squared-L2 (Euclidean) vector length

Vector Space dimensionNote: Change Y to 2,4,6 (colinear with X but twice as long):

28 - 24 4r = ------------------------------ = ------------ = 1 SQRT((14-12)(56-48)) SQRT(16)

So what are we measuring here?Angle between vectors?Why not just use Arcos(xoy/|x||y|)?Or just cos of the angle between themwhich is xoy / (|X| |y|)?

Page 6: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

6

Pearson's correlation coefficient example z-score formula

A simpler looking formula can be used if the numbers are converted into z scores, where zx is the variable X converted into z scores and zy is the variable Y converted into z scores.

The standard normal distribution is a normal distribution with amean of 0 and a standard deviation of 1. Normal distributionscan be transformed to standard normal distributions by the formula: where X is a score from the original normal distribution, μ is the mean of the original normal distribution, and σ is the standard deviation of original normal distribution. The standard normal distribution is called the z distribution. A z score always reflects the number of standard deviations above or below the mean a particular score is.

For instance, if a person scored a 70 on a test with a mean of 50 and astandard deviation of 10, then they scored 2 standard deviations abovethe mean. Converting the test scores to z scores, an X of 70 would be: So, a z score of 2 means the original score was 2 standard deviations above the mean. Note that the z distribution will only be a normal distribution if the original distribution (X) is normal.

Page 7: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

7

Pearson's correlation coefficient examples

Page 8: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

8

Problem and Problem and AlternativeAlternative

Problem:When n is large, arranging symmetric datasets into n x n may be impractical (n2 tuples)

Alternative: Organize the symmetric datasets into n’ x m, n’ >> m, instead of n x n

In other words, the cardinality is extended, the dimension is narrowed, but the number of elements remains the same, 2n, as in n x n.

Page 9: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

AlternativeAlternative

Algorithm: Determine n’ and mInput: moOutput: n’ and m

let mu = md = mowhile((n2 mod mu)!=0||(n2 mod md)!=0) mu++ md--endwhileif(mu - mo)<(mo – md) m = muelse m = mdendifn’ = n2 / m

n-1n-1n-1n-1n-1

n-1

n-1

n-1

OOdOOdOOdOOd

OOdOOdOOdOOd

OOdOOdOOdOOd

OOdOOdOOdOOd

,,,,

,,,,

,,,,

,,,,

2221202

22222122022

12212112012

02202102002

Page 10: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

10

mnjectDistinctOb '

jectDistinctOb

nrColTotalSetPe

'

'

)(n

ijectDistinctObiCol

jectDistinctObrColTotalSetPeiiRow )mod()(

Page 11: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

11

Performance Performance EvaluationEvaluation

Two datasets: 4,000 and 8,000 objects It takes 1.71 and 6.91 minutes to compute

pair-wise Euclidian distance of 4,000 and 8,000 objects respectively

Dataset # Vertical Bit Vectors

Dataset # Vertical Bit Vectors

8K x 8000 82,143 4K x 4000 41,730

16K x 4000 41,311 8K x 2000 20,958

32K x 2000 20,777 16K x 1000 10,497

64K x 1000 10,452 32K x 500 5,250

128K x 500 5,251 64K x 250 2,626

Page 12: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

12

Performance Performance EvaluationEvaluation

4Kx4000 8Kx2000 16Kx1000 32Kx500 64Kx2500

2000

4000

6000

8000

10000

12000

(Dataset Arrangement)

Tim

e in

Sec

onds

Generating Vertical Bit Vectors

4Kx4000 8Kx2000 16Kx1000 32Kx500 64Kx2500

2

4

6

8

10

12

(Dataset Arrangement)

Tim

e in

Sec

onds

Loading Vertical Bit Vectors

Page 13: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

13

Performance Performance EvaluationEvaluation

8Kx8000 16Kx4000 32Kx2000 64Kx1000 128Kx5000

1

2

3

4

5

6

7

8x 10

4

(Dataset Arrangement)

Tim

e in

Sec

onds

Generating Vertical Bit Vectors

8Kx8000 16Kx4000 32Kx2000 64Kx1000 128Kx5000

5

10

15

20

25

30

35

40

45

50

(Dataset Arrangement)

Tim

e in

Sec

onds

Loading Vertical Bit Vectors

Page 14: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

14

Performance Performance EvaluationEvaluation

Definitions:

Neighbors:

Density:

),( )( 2 jiji OOdOONbr

0

1

)(2

)(2

)(2)(

),()(

),()(

bkiik

ki

ONbrOjii

ONbrOjii

PnmPrcPnmrc

OOdPnmrc

OOdOden

ij

ij

d2(Oi,Oj)

*

Page 15: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

15

Performance Performance EvaluationEvaluation

Execution

4Kx4000 8Kx2000 16Kx1000 32Kx500 64Kx250

Density

Cluster

Density

ClusterDensit

yCluster

Density

ClusterDensit

yCluster

1 8.04 0.21 6.41 0.27 6.96 0.42 10.03 0.74 18.02 1.41

2 8.08 0.21 6.37 0.27 6.98 0.42 10.04 0.74 18.00 1.40

3 7.99 0.21 6.39 0.27 6.98 0.42 10.05 0.73 18.03 1.39

4 7.98 0.21 6.36 0.28 6.99 0.41 10.04 0.73 17.99 1.40

5 8.00 0.21 6.42 0.27 6.99 0.41 10.05 0.74 18.01 1.40

Average 8.02 0.21 6.39 0.27 6.98 0.42 10.04 0.74 18.01 1.40

Total Time 8.23 6.66 7.40 10.78 19.41

4Kx4000 8Kx2000 16Kx1000 32Kx500 64Kx2500

2

4

6

8

10

12

14

16

18

20

(Dataset Arrangement)

Tim

e in

Sec

onds

Determining Density

Discovering Clusters

4Kx4000 8Kx2000 16Kx1000 32Kx500 64Kx2506

8

10

12

14

16

18

20

(Dataset Arrangement)

Tim

e in

Sec

onds

Total Clustering Time

Page 16: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

16

Performance Performance EvaluationEvaluation

Execution

8Kx8000 16Kx4000 32Kx2000 64Kx1000 128Kx500

Density

Cluster

Density

ClusterDensit

yCluster

Density

ClusterDensit

yCluster

1 33.60 7.03 22.00 8.10 23.46 12.71 37.58 22.99 71.27 43.97

2 34.36 7.12 21.22 8.02 23.51 12.74 37.60 22.99 71.27 43.96

3 33.15 6.92 21.14 8.04 23.46 12.71 37.59 22.98 71.23 43.93

4 33.28 6.93 21.22 8.06 23.48 12.71 37.53 22.98 71.20 43.96

5 33.15 7.03 21.68 8.06 23.49 12.73 37.55 22.97 71.25 43.92

Average 33.51 7.01 21.45 8.06 23.48 12.72 37.57 22.98 71.24 43.95

Total Time 40.51 29.51 36.20 60.55 115.19

8Kx8000 16Kx4000 32Kx2000 64Kx1000 128Kx5000

10

20

30

40

50

60

70

80

(Dataset Arrangement)

Tim

e in

Sec

onds

Determining Density

Discovering Clusters

8Kx8000 16Kx4000 32Kx2000 64Kx1000 128Kx50020

30

40

50

60

70

80

90

100

110

120

(Dataset Arrangement)

Tim

e in

Sec

onds

Total Clustering Time

Page 17: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

17

SummarySummary

We have presented an alternative arrangement of symmetric dataset (unipartite undirected graphs) for vertical clustering algorithms and analyzed its performance.

Narrowing the dimension and extending the cardinality of symmetric datasets is useful.

Our study shows that a dimension in the range of 1,000 to 2,000 is a good option for datasets containing 4,000 and 8,000 objects.

Page 18: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

Appendix (wikipedia on Pearson's Coef.)Appendix (wikipedia on Pearson's Coef.)Pearson's product-moment coefficient Mathematical properties

Linear correlations between 1000 pairs of numbers. The data are graphed on the lower left and their correlation coefficients listed on the upper right. Each set of points correlates maximally with itself, as shown on the diagonal (all correlations = +1). The correlation ρX, Y between two random variables X and Y with

expected values μX and μY and standard deviations σX and σY is defined as: Since μX = E(X), σX2 = E(X2) − E2(X) and likewise for Y,

also write:

The correlation is defined only if both standard deviations are finite and both of them are nonzero. It is a corollary of the Cauchy-Schwarz inequality that the correlation cannot exceed 1 in absolute value. The correlation is 1 in the case of an increasing linear relationship, −1 in the case of a decreasing linear relationship, and some value in between in all other cases, indicating the degree of linear dependence between the variables. The closer the coefficient is to either −1 or 1, the stronger the correlation between the variables. If the variables are independent then the correlation is 0, but the converse is not true because the correlation coefficient detects only linear dependencies between two variables. Here is an example: Suppose the random variable X is uniformly distributed on the interval from −1 to 1, and Y = X2. Then Y is completely determined by X, so that X and Y are dependent, but their correlation is zero; they are uncorrelated. However, in the special case when X and Y are jointly normal, independence is equivalent to uncorrelatedness. A correlation between two variables is diluted in the presence of measurement error around estimators of one or both variables, in which case disattenuation provides a more accurate coefficient.

The sample correlation: If we have a series of n  measurements of X  and Y  written as xi  and yi  where i = 1, 2, ..., n, then the Pearson product-moment correlation coefficient can be used to estimate the correlation of X  and Y . The Pearson coefficient is also known as the "sample correlation coefficient". It is especially important if X  and Y  are both normally distributed. The Pearson correlation coefficient is then the best estimate of

the correlation of X  and Y . The Pearson correlation coefficient is written:

where and are the sample means of xi  and yi , sx  and sy  are the sample standard deviations of xi  and yi  and the sum is from i = 1 to n. As with the population correlation, we may rewrite this as–

Again, as is true with the population correlation, the absolute value of the sample correlation must be less than or equal to 1. Though the above formula conveniently suggests a single-pass algorithm for calculating sample correlations, it is notorious for its numerical instability (see below for something more accurate).

Page 19: An Alternative Arrangement of Symmetric Datasets for Vertical Clustering Algorithms

The sample correlation coefficient is the fraction of the variance in yi  that is accounted for by a linear fit of xi  to yi . This is written

where σy|x2  is the square of the error of a linear fit of yi  to xi  by the equation y = a + bx

and σy2  is just the variance of y

Note that since the sample correlation coefficient is

symmetric in xi  and yi , we will get the same value for a fit of xi  to yi :

This equation also gives an intuitive idea of the correlation coefficient for higher dimensions. Just as the above described sample correlation coefficient is the fraction of variance accounted for by the fit of a 1-dimensional linear submanifold to a set of 2-dimensional vectors (xi , yi ), so we can define a correlation coefficient for a fit of an m-dimensional linear submanifold to a set of n-dimensional vectors. For example, if we fit a plane z = a + bx + cy  to a set of data (xi , yi , zi ) then the correlation coeffi

cient of z  to x  and y  is

Non-parametric correlation coefficients: Pearson's correlation coefficient is a parametric statistic, and it may be less useful if the underlying assumption of normality is violated. Non-parametric correlation methods, such as Spearman's ρ and Kendall's τ may be useful when distributions are not normal; they are a little less powerful than parametric methods if the assumptions underlying the latter are met, but are less likely to give distorted results when the assumptions fail.

Other measures of dependence among random variables: To get a measure for more general dependencies in the data (also nonlinear) it is better to use the correlation ratio which is able to detect almost any functional dependency, or mutual information which detects even more general dependencies.

Copulas and correlation: Most people erroneously believe that the information given by a correlation coefficient is enough to define the dependence structure between random variables. But to fully capture the dependence between random variables we must consider the copula between them. The correlation coefficient completely defines the dependence structure only in very particular cases, for example when the cumulative distribution functions are elliptic (as with, for example, the multivariate normal distribution).

Correlation matrices: The correlation matrix of n random variables X1, ..., Xn is the n  ×  n matrix whose i,j entry is corr(Xi, Xj). If the measures of correlation used are product-moment coefficients, the correlation matrix is the same as the covariance matrix of the standardized random variables Xi /SD(Xi) for i = 1, ..., n. Consequently it is necessarily a non-negative definite matrix. The correlation matrix is symmetrical (correlation between Xi and Xj is the same as the correlation between Xj and Xi).

"Correlation does not imply causation": The conventional dictum that "correlation does not imply causation" is treated in the article titled spurious relationship. See also correlation implies causation (logical fallacy). However, correlations are not presumed to be acausal, though the causes may not be known.

Computing correlation accurately in a single pass: The following algorithm (in pseudocode) will estimate correlation with good numerical stability: sum_sq_x = 0 sum_sq_y = 0 sum_coproduct = 0 mean_x = x[1] mean_y = y[1] last_x = x[1] last_y = y[1] for i in 2 to N: sweep = (i - 1.0) / i delta_x = x[i] - mean_x delta_y = y[i] - mean_y sum_sq_x += delta_x * delta_x * sweep sum_sq_y += delta_y * delta_y * sweep sum_coproduct += delta_x * delta_y * sweep mean_x += delta_x / i mean_y += delta_y / i pop_sd_x = sqrt( sum_sq_x / N ) pop_sd_y = sqrt( sum_sq_y / N ) cov_x_y = sum_coproduct / N correlation = cov_x_y / (pop_sd_x * pop_sd_y)

For an enlightening experiment, check the correlation of {900,000,000 + i for i=1...100} with {900,000,000 - i for i=1...100}, perhaps with a few values modified. Poor algorithms will fail.

Appendix (wikipedia on Pearson's Coef.) -2Appendix (wikipedia on Pearson's Coef.) -2