譚德燕,唐德玉
摘 要: 針對傳統K-means算法容易陷入局部最優的缺點,提出了基于粒子群優化的K-means算法。以肝臟疾病為例對新方法在醫學中的應用進行了探討,使用 MATLAB編程工具進行驗證,實驗結果表明,新方法更優于K-means算法。
關鍵詞: K-means; 粒子群優化; PSO-k; 肝病
中圖分類號:TP301 文獻標志碼:A 文章編號:1006-8228(2013)06-34-02
Application of k-means algorithm in diagnosis of liver diseases based on PSO
Tan Deyan, Tang Deyu
(Medical information engineering institute, Guangdong college of pharmacy, Zhongshan, Guangdong 528458, China)
Abstract: In order to overcome the weakness of the traditional K-means algorithm that it is easily trapped into local optimization, a new K-means algorithm based on particle swarm optimization is presented in this paper. Taking the liver disease diagnosis as an example, the application of new methods in medicine is discussed and verified by MATLAB programming tool. The experimental results show that the new method is better than the traditional K-means algorithm.
Key words: K-means; particle swarm optimization; the PSO-k; liver disease
0 引言
數據挖掘技術中,聚類分析[1]被用作數據分析、數據理解和模式識別的有效工具,其中K-means算法是聚類分析中廣泛應用的算法,它具有簡單、快速的優點。本文針對K-means算法易陷入局部最小值和對初始值敏感的問題,引入粒子群算法,通過與K-means算法的有效結合來改善K-means的全局尋優能力;以肝功能疾病的診斷為例,對新方法是否改進了K-means算法進行了研究。
1 K-means算法
K-means算法[2]是J. B. MacQueen在1967年提出的,它是一種被廣泛應用于科學研究和工業應用中的經典聚類算法。
K-means算法的核心思想是把n個數據對象劃分為k個聚類,使每個聚類中的數據點到該聚類中心的平方和最小。其算法流程圖如圖1所示。
首先從n個數據對象中任意選擇k個對象作為初始聚類中心;而對于所剩下的其他對象,則根據它們與這些聚類中心的相似度(距離),分別將它們分配給與其最相似的(聚類中心所代表的)聚類。然后再計算每個新聚類的聚類中心(該聚類中所有對象的均值)。不斷重復這一過程,直到標準測度函數開始收斂為止。一般都采用計算歐氏距離的方式進行計算。具體計算公式如下:
⑴
[滿足終止條件][開始][結束][選擇……