Optimized kmeans clustering with intelligent initial centroid selection






































- Slides: 38
Optimized k-means clustering with intelligent initial centroid selection for web search using URL and tag contents WIMS ‘ 11 Proceedings of the International Conference on Web Intelligence, Mining and Semantics, Article No. 65, ACM, 2011 S. Poomagal Research Scholar, PSG College of Technology, Coimbatore, Tamilnadu, India T. Hamsapriya PSG College of Technology, Coimbatore, Tamilnadu, India 1 2013 / 05 / 07 haseshun
Index 1. Introduction 2. K-means Clustering Algorithm 3. Proposed Method 4. Experimental Result 5. Conclusion 2
1. Introduction • 最近誰でもドキュメントを作成し、Web上で提供する自由がある。 Nowadays, there is a freedom for anyone to create documents and host it over the web. これにより、必要なドキュメントを見つけることが困難。 Due to this, there is a difficulty in finding the necessary document. • 検索エンジンの検索結果の数がたった 10個であり、ユーザは最初の 10 個あるいは 20個の結果だけを見る習慣がある。 The number of search results of a search engine is only 10 and the users have the habit of seeing only the first 10 or 20 results. 20個の結果内に適切なドキュメントを表示することが時々できない。 It is sometimes not possible to display the relevant documents within 20 results. 3
1. Introduction • この問題への解決法(A possible solution to this problem) 用語をWeb・ページ全体から抽出 • ユーザにクラスタ・ラベルを読むことで必要なグループを識別させ 用語をスニペットから抽出 The terms were extracted from the entire web る様々なグループに検索結果をクラスタリングする。 • The terms page. were extracted from the snippets. Cluster search results into different groups that makes users to identify ×作成されたクラスタの質は好ましくない。 ○作成されたクラスタはよい品質 。 their required group by reading the cluster labels. ×the ○The qualityclusters of produced clusters willgood not be acceptable. produced are of quality. ×スニペットがそのWebページの識別のための有用な用語 ×ベクトルのサイズは非常に大きい。 検索結果クラスタリング(Search results clustering) を持たないことが時々あり得る。 ×The size of the vector is very large. ×It is sometimes possible that these sentences may not have useful terms for identifying that web page. • 用語をWeb・ページ全体から抽出 The terms were extracted from the entire web page. • 用語をスニペットから抽出 The terms were extracted from the snippets. 4
1. Introduction • クラスタの質(The quality of clusters) • URL、タイトルタグおよびメタタグから用語を抽出することで改善。 Improved by extracting terms from the URL, Title tag and Meta tag. Ø URL : Webページに対する識別を与え、URL中の用語が有益。 URL provides the identification for the web page and the terms in it are informative. Ø タイトルタグ(Title tag) : 常にタイトルは有用な用語を持つ。 Always the title of a page has useful terms. Ø メタタグ(Meta tag) : どのWebページもメタ・タグの主用途はその ページで使用されるキーワードを含むことである。 The major use of Meta tag on any web page is to include the keywords which are used in that page. 5
1. Introduction • K-meansクラスタリングアルゴリズム K-means clustering algorithm • 最も一般的に用いられているクラスタリングアルゴリズム K-means clustering is the most commonly used clustering algorithm. 本論文では、知的な方法での最初の重心の選択によって、 K-meansアルゴリズムのパフォーマンスを最適化する。 This paper optimizes the performance of K-means algorithm • このアルゴリズムの問題(The problem with this algorithm) by selecting the initial centroids in an intelligent way. Ø 初期重心のランダム選択(The random selection of initial centroids) Ø クラスタの数K(The number of clusters (K)) 上記の選択がアルゴリズムの全体的なパフォーマンスに影響する Initial parameters selection affects the overall performance of the algorithm 6
Index 1. Introduction 2. K-means Clustering Algorithm 3. Proposed Method 4. Experimental Result 5. Conclusion 7
2. K-means Clustering Algorithm • 最も一般的に用いられているクラスタリングアルゴリズム K-means clustering is the most commonly used clustering algorithm. • K-meansクラスタリングアルゴリズム K-means clustering Algorithm 1. 入力 : ドキュメント集合、クラスタの数(K) Initially the algorithm takes the collection of documents, number of clusters (K) and centroids of each cluster as input. 2. ドキュメントの集合からランダムに選ばれるK個のドキュメントと 一致するクラスタの初期重心を選択。 Choose initial cluster centroids to coincide with K randomly selected documents from the document set. 8
2. K-means Clustering Algorithm • K-meansクラスタリングアルゴリズム(続き) K-means clustering Algorithm(cont. ) 3. ドキュメントを最も近いクラスタに割り当てる。 Assign each document to its closest cluster. 4. クラスタの重心を再計算。 Recompute the cluster centroids. 5. 新しいクラスタへドキュメントの再割り当てがある場合は、ステッ プ 3へ。変化がなくなるまで繰り返す。 If there is a reassignment of documents to the new cluster, go to step 3. Typical stopping criteria is : Groups formed by the subsequent iterations must be same. 9
2. K-means Clustering Algorithm • 例(Example) 1. 入力(input) ドキュメントの集合 the collection of documents クラスタ数(K) : 3 the number of clusters(K) : 3 10
2. K-means Clustering Algorithm • 例(Example) 1. 入力(input) ドキュメントの集合 the collection of documents クラスタ数(K) : 3 the number of clusters(K) : 3 2. ランダムに選ばれるK個のドキ ュメントと一致するクラスタの 初期重心を選択。 Choose initial cluster centroids to coincide with K randomly selected documents. 11
2. K-means Clustering Algorithm • 例(Example) 3. ドキュメントを最も近いクラ スタに割り当てる。 Assign each document to its closest cluster. 12
2. K-means Clustering Algorithm • 例(Example) 4. クラスタの重心を再計算。 Recompute the cluster centroids. 13 クラスタ cluster の重心 : centroid:
2. K-means Clustering Algorithm • 例(Example) 5. 新しいクラスタへドキュメント の再割り当てがある場合は、ス テップ 3へ。 If there is a reassignment of documents to the new cluster, go to step 3. 14
2. K-means Clustering Algorithm • 例(Example) 5. 変化がなくなるまで繰り返す。 Typical stopping criteria is : Groups formed by the subsequent iterations must be same. 15
2. K-means Clustering Algorithm • K-meansクラスタリングアルゴリズムの欠点 The disadvantage of K-means clustering algorithm • クラスタ重心はランダムに選ばれる。 この影響として・・ As the effects of this・ Cluster centroids are chosen randomly. ・ 本論文では中間点の計算により初期重心を選択する。 This paper selects initial centroids by calculating the midpoint. 1. 重心の選択は、アルゴリズムの収束時間に影響を与える。 Selection of centroid affects the convergence time of the algorithm. 2. 同じデータセットにおいて、異なる重心選択は異なるクラスタ を作成するだろう。 For the same data set, different centroid selection will produce different kinds of clusters. 16
Index 1. Introduction 2. K-means Clustering Algorithm 3. Proposed Method 4. Experimental Result 5. Conclusion 17
3. Proposed Method • 提案手法(Proposed Method) 1. 用語抽出(URL、タイトル・タグ、メタ・タグ) Term Extraction (URL, Title tag and Meta tag) 2. ストップワードの削除および語幹処理 Stop word removal and Stemming 3. TFIDFの計算 TFIDF calculation 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm 5. クラスタ・ラベルの生成 Cluster label generation 18
3. Proposed Method 1. 用語抽出(URL、タイトル・タグ、メタ・タグ) Term Extraction (URL, Title tag and Meta tag) • テキスト内容に加えて、Webドキュメントはタグ情報を含む。 In addition to text contents web documents contains tag information. • 意味のある用語を抽出するために、このタグ情報および句読点は 取り除かれるべき。(トークン化) This tag information and the punctuations should be removed from the document to extract meaningful terms. (Tokenization) • 例(Example) Ø 入力(Input) : Friend, Romans, Country men, lend me your ears; Ø 出力(Output) : Friend Romans Country men lend me your ears 19
3. Proposed Method 2. ストップワードの削除および語幹処理 Stop word removal and Stemming • ストップワード(stop word) Ø 一般的であるなどの理由で処理対象外とする単語 The words treated as the outside of the object of processing because it is general words. Ø 例(Example) : 「is」, 「was」, 「are」, 「were」, 「what」 • Webページからの抽出用語はストップワードリストと比較される。 The terms extracted from the web pages are compared with the stop words list. • 抽出された用語の中で見つかったストップワードを除去。 Stop words found in the extracted terms are removed. 21
3. Proposed Method 2. ストップワードの削除および語幹処理 Stop word removal and Stemming • 語幹処理(stemming) Ø 語形変化した単語や派生した単語をその原型に変えること。 To reduce inflectional forms and sometimes derivationally related forms of a word to a common base form. • 例(Example) Ø am, are, is → be Ø the boy’s cars are different colors → the boy be differ color 22
3. Proposed Method 3. TFIDFの計算 TFIDF calculation • TFIDF • ドキュメント中に出現した特定の単語がどのくらい特徴的である かを識別するための重み付けの方法 The method of weighting for identifying how characteristic the specific word which appeared in the document is. 24
3. Proposed Method 3. TFIDFの計算 TFIDF calculation • TFIDF Ni, j : 用語iのドキュメントjでの出現回数 Ni, j is the number of times the term i appears in the document j. NTj : ドキュメントjの用語の総数 NTj is the total number of terms in the document j. |D| : ドキュメントの総数 |D| is the total number of documents. |d : ti ∈ d| 用語iを含むドキュメント数 : |d : ti ∈ d| is the number of documents in which the term ti appears. 25
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • 改良型K-meansアルゴリズム Improved K-means Algorithm 1. としてKの初期値を割り当てる(クラスタは 1つも作成されない)。 Assign the initial value of K (No of clusters to be created) as 1. 提案手法の使用によりKの初期重心を選択。 Select K initial centroids by using the proposed method. 2. 最も近いクラスタに各ドキュメントを割り当てる。 Assign each document to the nearest cluster. 26 .
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • 改良型K-meansアルゴリズム(続き) Improved K-means Algorithm(cont. ) 4. クラスタ重心を再計算。 Recompute the cluster centroids. 5. 新しいクラスタへドキュメントの再割り当てがある場合は、ステ ップ 3へ。変化がなくなるまで繰り返す。 If there is a reassignment of documents to the new cluster, go to step 3. Typical stopping criteria is : Groups formed by the subsequent iterations must be same. 27
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • Kの初期重心を選択する方法 The Method of selecting K initial centroids. 1. TFIDF行列からscale factor(SF)を計算する。 Calculate the scale factor (SF) from the TFIDF. SF = MAX(Ti) / K Ti : i番目の用語の数 K : クラスタの数 Ti is the ith term in the TFIDF matrix. K is the Number of Clusters 28
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • Kの初期重心を選択する方法(続き) The Method of selecting K initial centroids. (cont. ) 2. 列(T 1〜TN)、行(S 1~SK+1)の行列を作成し、各列の値において、0 から始まり、1行ずつSF分増加させる。 Form another matrix with T 1 to TN as columns and S 1 to SK+1 as rows and fill in each column starting from 0 and increase the value using the scale factor. 3. 新しい行列の隣接した行の中間値を取り、重心を計算する。 Calculate the centroids by taking the mean of the values in adjacent rows of the newly created matrix. 29
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • 例(Example) 1. TFIDF行列からscale factor(SF)を計算する。 Calculate the scale factor (SF) from the TFIDF行列(TFIDF Matrix) T 1 T 2 T 3 T 4 T 5 D 1 4 7 9 20 12 D 2 6 10 25 10 15 D 3 3 14 36 13 18 D 4 8 9 10 12 14 K = 2と仮定する。 Assume the value of K to be 2. それぞれの用語のSF(SF for each term) T 1 : MAX(T 1) / 2 = 8 / 2 = 4 T 2 : MAX(T 2) / 2 = 14 / 2 = 7 T 3 : MAX(T 3) / 2 = 36 / 2 = 18 T 4 : MAX(T 4) / 2 = 20 / 2 = 10 T 5 : MAX(T 5) / 2 = 18 / 2 = 9 30
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • 例(Example) 2. 列(T 1〜TN)、行(S 1~SK+1)を取る行列を作成し、各列の値において、 0から始まり、1行ずつSF分増加させる。 Form another matrix with T 1 to TN as columns and S 1 to SK+! as rows and fill in each column starting from 0 and increase the value using the scale factor. T 1 T 2 T 3 T 4 T 5 S 1 0 0 0 S 2 4 7 18 10 9 S 3 8 14 36 20 18 K=2 SF T 1 : 4, T 2 : 7, T 3 : 18, T 4 : 10, T 5 : 9 新しい行列は 3行(K+1)である。 New matrix have 3 rows (K+1). 31
3. Proposed Method 4. クラスタリングアルゴリズムの適用 Applying clustering algorithm • 例(Example) 3. 新しい行列の隣接した行の中間値を取り、重心を計算する。 Calculate the centroids by taking the mean of the values in adjacent rows of the newly created matrix. T 1 T 2 T 3 T 4 T 5 S 1 初期重心(The initial centroids) S 2 C 1 = {(0+4)/2, (0+7)/2, (0+18)/2, (0+10)/2, (0+9)/2} S 3 = {2, 3. 5, 9, 5, 4. 5} C 2 = {(4+8)/2, (7+14)/2, (18+36)/2, (10+20)/2, (9+18)/2} = {6, 10. 5, 27, 15, 13. 5} 32 0 0 0 4 7 18 10 9 8 14 36 20 18
3. Proposed Method 5. クラスタ・ラベルの生成 Cluster label generation • ラベルの生成は各クラスタ中のドキュメントのタイトルおよ びメタタグから用語を抽出することにより行われる。 Creation of labels is done by extracting the terms from only Title and Meta tag contents of the documents in each cluster. • すべての抽出された用語において、用語の出現頻度を計算。 For all the extracted terms, term frequency is calculated. • 最も高い出現頻度である用語をクラスタのラベルとする。 The term which is having highest term frequency is taken as the label for the cluster. 33
Index 1. Introduction 2. K-means Clustering Algorithm 3. Proposed Method 4. Experimental Result 5. Conclusion 34
4. Experimental Result • 実験について(About the experiments) • 200個のクエリをyahoo, google, bingから検索。 For the 200 queries, 200 results from yahoo, google and bing are retrieved. • 使用するアルゴリズム(Algorithms using) Ø スニペットに基づくクラスタリングアルゴリズム Snippet based clustering algorithm Ø URLとタグ内容に基づく既存のK-meansクラスタリングアルゴリ ズム URL and Tag content based traditional K-means clustering algorithm Ø URLとタグ内容に基づく最適化K-meansクラスタリングアルゴリ ズム URL and Tag content based optimized K- means clustering algorithm 35
4. Experimental Result • 実験について(About the experiments) • クラスタ内距離およびクラスタ間距離で比較。 Compare in terms of intra-cluster distance and inter-cluster distance. Ø クラスタ内距離(Intra-cluster distance) L 1 = Ø クラスタ間距離(Inter-cluster distance) L 2 = 36
4. Experimental Result • クラスタ内距離(Intra-cluster distance) • 各クラスタのドキュメントが互いとより高い関係性があるので、提 案手法で生成されたクラスタがより小さなクラスタ内距離である。 The clusters produced by the proposed method have less intra-cluster distance so that the documents in each cluster are highly related to one another. 37
4. Experimental Result • クラスタ間距離(Inter-cluster distance) • 提案手法は、各クラスタのドキュメントが他のクラスタのドキュメ ントにあまり依存しないようなクラスタを生成した。 The proposed method have produced clusters such that the documents in each cluster are highly independent of the documents in other clusters. 38
Index 1. Introduction 2. K-means Clustering Algorithm 3. Proposed Method 4. Experimental Result 5. Conclusion 39
5. Conclusion • K-meansクラスタリングは知的な方法での最初の重心の選択により最 適化される。 • In this work, K-means clustering is optimized by selecting the initial centroids in an intelligent way. • 検索結果をクラスタリングする提案手法が高品質なクラスタを生成す ることを結果が示す。 • The results show that the proposed method of clustering search results has produced high quality clusters. • 今後、クラスタの数(K)の選択のための新しい手法の導入により研究が 発展することができる。 • In future, this work can be extended by introducing a new method for the selection of the number of clusters (K). 40