• Nie Znaleziono Wyników

A proposal of a new method of choosing starting points for k-means grouping

N/A
N/A
Protected

Academic year: 2021

Share "A proposal of a new method of choosing starting points for k-means grouping"

Copied!
6
0
0

Pełen tekst

(1)

Jerzy Korzeniew ski

A P R O P O S A L O F A N E W M E T H O D O F C H O O S IN G ST A R T IN G PO INTS FO R A-MEANS G R O U P IN G

A B S T R A C T . W hen one groups set elem ents w ith the help o f £-m eans it is crucial to ch o o se starting points properly. I f they are ch osen incorrectly on e m ay arrive at badly grouped elem ents. In the paper a new m ethod o f ch oosin g starting points is proposed. It is based on the distance matrix only. Starting points are ch o sen so as to im prove the classical m ethod o f ch o o sin g points w hich are as far from one another as p ossib le. The quality o f grouping is a ssessed by m eans o f silhouette in d ices — it is com pared w ith the quality o f grouping d on e w ith random ly chosen starting points and w ith m axim um distance interval m ethod. Sets from Euclidean spaces are generated w ith the help o f C L U ST G E N softw are written by J. M illigana.

K ey w o rd s: cluster an alysis, £-m eans m ethod, starting points, silhouette indices.

I. IDEA O F NEW A LG O R IT H M

There is a number o f method o f choosing starting points for A'-means clustering. This choice influences heavily the outcome o f grouping therefore it is very important to use most effective methods. Unfortunately there seems to be no universally good method i.e. a method that would perform well for all kinds o f data sets. For example, the classical Hartigan-Wong s (Hartigan-Wong 1979 ) method (which will be later called the maximum distance interval method) works well for sets with clearly cut clusters but for slightly fuzzy sets it is actually on a par with the random choice method (see table 2). The search for a new, better method o f choosing starting points was performed in a couple o f directions.

In the first direction we applied the idea of comparing the distributions o f pairwise distances between a fixed data point and all other points. The shape of this distribution is closely connected with the number o f clusters that one should distinguish and even with the way o f assigning points to clusters. This distribution (for all pairwise distances) for two two-dimensional data sets

(2)

depicted in Fig. 1, is presented in Fig. 2 and Fig. 3 . As it can be seen, e.g. the number o f clusters in a data set is limited from below by the number o f local maximums o f the distribution. The way o f defining a local maximum would, however, be a big problem. The investigation of similar distributions but for fixed single points may lead to interesting observations. For example, the points close to the centroids o f clusters (good candidates for starting points for any grouping method) have similar shape o f this distribution and the shape is rather different from the shape o f the distribution for points lying far from the centroids. We tried to identify this shape by computing some measures o f shape like asymmetry and curtosis. Points close to centroids usually have small asymmetry. However, this feature is not sufficient for picking up good starting points, probably, due to the fact that a point lying far from cluster centres, e.g. in between two clusters, may also have small asymmetry coefficient caused by the two small clusters relatively (in comparison with other clusters) close to this point. The method based on smallest asymmetry with a side condition preventing the choice o f too close starting points, gave roughly twice smaller number o f wrongly assigned (the criterion is given later) points than the random choice method.

set 1 set 2

Fig. 1 Two two-dimensional data sets. The first set consists o f two clusters and its diameter is about 100 units, the second set consists o f eight clusters and its diameter is about 220 units.

(3)

a 1..

relative frequency

50 100 150 distance

Fig. 2 The shape o f the distribution o f relative frequency o f pairwise distances for all pairs o f points for set I . The frequency is presented in classes o f width 2 and is related to the frequency o f

the most frequent class

a 1

-relative frequency

so

Too

i4o

distance

Fig. 3 The shape o f the distribution o f relative frequency o f pairwise distances for all pairs o f points for set 2. The frequency is presented in classes o f width 2 and is related to the frequency

o f the most frequent class

In the second direction, and this approach turned out to be more successful, we tried to start in the first stage in a similar way as in the maximal distance interval method and to refine the points in the next stage. Thus, if к represents the number o f clusters (and starting points) the new proposal consists ol the following steps:

1. We take first к data points from the list of the data set points and call them current starting points.

(4)

2. We take the k + 1 data point from the list and compute the distances to all current starting points.

3. If the distances computed in step 2 are greater than all o f the distances between the current starting points we exchange one o f the current starting points (one from the pair with smallest single distance out o f all the distances to all other current starting point) for the £+1 data point.

4. We repeat steps 2 and 3 for the rest o f the data set points arriving, in this way, at the set o f к far spaced current starting points.

5. We consider the pair of two current starting points with the smallest distance d. Each o f the points o f this pair we change for a point whose distance to this point is smaller than Vi*d and whose sum o f distances to all other points with the same property is smallest.

6. We repeat step 5 for all other pairs o f current starting points respectively to growing distances between pairs. Thus, we get the final set o f к starting points.

The basic modification of the well known classical maximum distance interval method is contained in step 5 o f the new proposal. In this step we tried a number o f new ideas - most o f them being based on picking up points with smallest (possibly negative) asymmetry o f the distribution o f distances to some chosen other points. All of these ideas did not give satisfying results, probably, due to reasons mentioned while describing the first approach. The, seemingly, simplest method o f picking up point with smallest mean (or summary) distance to some other points turned out to be better. The only artificial choice here is the choice of half o f the distance between the pair o f starting points. Such a way is definitely artificial (though at first glance seems natural), however, this fact creates some opportunities for further investigations and possible modifications.

III. PER FO R M A N C E ASSESSM ENT

We used the M illigan’s CLUSTGEN programme, (see. Milligan 1985, available at http://www.pitt.edu/~csna/Milligan/readme.html), to generate 216 data sets, each containing 100 elements. The sets were distributed equally with respect to the dimensions o f the Euclidean spaces i.e. 72 sets in each o f R4, R6 and Rs spaces. The division with respect to the number o f clusters was also equal i.e. 54 sets with 2 clusters, 54 with 3 clusters, and 54 with 4 clusters and 54 with 5 clusters. This experiment was done twice, first time sets with well separated clusters were generated, second time 40 uniformly distributed points were added to each set so as to make the clusters slightly fuzzy i.e. not so well separated. Then, the А-means method (for three different methods o f choosing starting points) was applied to group each set in the form o f the number of clusters equal

(5)

to the number predetermined for the set’s generation. To assess the quality o f grouping we applied the Rousseeuw’s silhouette indices (see e.g. Gordon 1999). The silhouette index for the i-th point is given by the formula

b(i)-a(i)

m ax { a (/),£>(/)} * (1)

where a(i) is the average distance between the /-th point and all other points in its cluster b(i) is the average distance to points in the nearest cluster. The Euclidean distance was used. The interpretation o f the silhouette index is the following: if a point has negative value o f the index it means that it shuld be rather assigned to some other cluster. Thus, the percentage o f points with negative value o f the silhouette index was used as the measure o f the quality o f grouping. The results are presented in tables 1 and 2.

Table 1 Arithmetic mean percentages o f wrongly classified points for sets with well separated clusters

Number o f clusters

Method

Random choice

Maximum distance

interval New proposal

2 clusters 18,6% 1,3% 1,2%

3 clusters 23,8% 2,4% 2,2%

4 clusters 24,1% 3,7% 3,5%

5 clusters 28,0% 2,9% 2,9%

Source: own investigations.

Table 2

Arithmetic mean percentages o f wrongly classified points for sets with fuzzy clusters

Number o f clusters Method Random choice Maximum distance interval New proposal 2 clusters 2 1,6% 8,3% 6,7% 3 clusters 25,2% 21,4% 8,5% 4 clusters 26,3% 2 2,2% 11,8% 5 clusters 29,9% 16,0% 10,7%

(6)

The new proposal turned out to be o f the same quality (or even maybe fractionally better) for sets with well separated clusters and much better for fuzzy sets than the classical method o f maximum distance interval. It seems that the method o f the new proposal has its prospects because its idea is based on modifying the classical approach by means o f analysing the distribution of pairwise distances. The very analysis o f the distribution o f pairwise distances so far did not give good results.

R E FE R E N C E S

G ordon A. D ., C la s s ific a tio n , Chapman & H all, 1999.

Hartigan J. A ., W o n g M. A ., A К -m e a n s c lu s te rin g a lg o r ith m , A p p lied Statistics 28, 1 0 0 -1 0 8 1979.

M illigan G. W ., A n a lg o r ith m f o r g e n e r a tin g a rtific ia l te st c lu s te rs , “P sychom etrika”, v ol. 50, no. 1, 1 2 3 -1 2 7 , 1985.

J e r z y K o rze n ie w s k i

P R O P O Z Y C JA N O W E J M ETO D Y W YBORU PU N K TÓ W STA R TO W Y C H DO G R U PO W A N IA M ETO D Ą AT-ŚREDNICII

G d y grupujem y punkty zbioru m etodą A-średnich to zasad n iczym problem em jest w ła śc iw y w yb ór p unktów startowych. Jeśli są one ź le w ybrane to grupow anie m o że być zle. W artykule zaproponow ana jest now a m etoda w yboru p unktów startow ych. M etoda ta jest oparta w y łą czn ie na znajom ości m acierzy o d leg ło ści. Punkty startow e są w ybierane tak, b y popraw ić w ybór , który otrzym am y przy p o m o c y m etod y klasycznej polegającej na w yb orze p unktów m o żliw ie jak najbardziej od sieb ie oddalonych. Jakość grupow ania jest oceniana przy p o m o cy in d ek sów sy lw etk o w y ch - porów nyw ana jest z ja k o ścią grupow ania otrzym anego przy lo so w y m w yb orze punktów startow ych oraz przy w yb orze m etod ą klasyczną. Zbiory z przestrzeni eu k lid eso w y ch są generow ane przy p o m o cy program u C L U S T G E N autorstwa J. M illigana.

Cytaty

Powiązane dokumenty

This example shows that the support points of a functional L with real coefficients bn are not always functions with real coefficients. We are not able to determine

However, in an attempt to remove the self-mapping assumption and the convexity of the domain of T, Kirk and Morales [11] obtained in 1981 a significant extension of this result

[r]

Finding new local minima in the multidimensional merit function space of an optical system is a difficult task especially for lithographic objectives that have many varia- bles..

Gleby karpackie fliszowe strefy leśnej są kształtowane przez pro­ ces bielicowy. Z procesem bielicowym kom binuje się w partiach podmok­ łych proces glejowy

In contrast to the bifurcation angle, we find that flow resistance ratio does not play a vital role in the evolution of flow field inside the droplet during the fission

The Kalman filter theory has been used to derive a set of difference equations by which the lateral position of a ship relative to the desired (straight) course can be estimated

The second equation has of course