群聚分析操作介绍-以SOM和K-means为例

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

切換回Data View輸入資料
SOM and K-means example
27
SPSS操作-群聚分析
選擇群聚分析工具下的“K-means Cluster”
SOM and K-means example
SPSS操作-群聚分析(續)
1.將x和y座標選為變數,no選為標籤項
2.群數的設定(可由系統隨機選取起始群心) ,亦可利用檔案匯入自設的群心
15
Matlab操作—呼叫類神經網路建構工具(續)
設定學習速率和鄰近半徑值
SOM and K-means example
16
Matlab操作—呼叫類神經網路建構工具(續)
得到設定好的網路
設定網路所需的 相關架構參數後, 接著選擇“Train..”, 將Train Pattern輸入, 以便網路進行學習模擬
plot(ans(1,:),ans(2,:),‘^b’)
(輸入繪圖指令將資料點標示出來)
Matlab操作—呼叫類神經網路建構工具(續)
按滑鼠左鍵二下, 以觀看其群聚結果
SOM and K-means example
23
K-means操作步驟

資料的輸入 SPSS操作
SOM and K-means example
選擇網路型態SOM
SOM and K-means example
13
Matlab操作—呼叫類神經網路建構工具(續)
設定網路的輸入資料來源
SOM and K-means example
14
Matlab操作—呼叫類神經網路建構工具(續)
設定map的權重數目 [5 2]即為10群
SOM and K-means example
進行網路的 SOM and K-means example Training
19
Matlab操作—呼叫類神經網路建構工具(續)
練訓完後得到網路輸出結果
按“Export”將結果匯 出
SOM and K-means example 20
Matlab操作—呼叫類神經網路建構工具(續)
將網路和輸出結果Export
SOM and K-means example
17
Matlab操作—呼叫類神經網路建構工具(續)
選擇Clustering所需的 input pattern
SOM and K-means example
Matlab操作—呼叫類神經網路建構工具(續)
設定欲學習次數
待設定完各相關參數後,
即可選擇“Train Network”
2.選擇“Simple”後按“Define”
SOM and K-means example
34
SPSS操作-群聚結果製圖(續)
將變數分別匯入後,按 “ok”
SOM and K-means example
35
SPSS操作-群聚結果製圖(續)
100
Cluster Number of Ca
10
80
9 8
選擇“Next”
SOM and K-means example 6
Matlab操作—匯入資料(續)
選擇“Finish”
SOM and K-means example 7
Matlab操作—匯入資料(續)
將輸入資料由直列轉橫列 c101’(c101為檔案名稱)
SOM and K-means example
SPSS操作-群聚分析(續)
最後按下ok進行 群聚動作
按下此鈕可選擇在“輸出報表”中要顯示的資 訊, 選擇後,按 continue 繼續 SOM and K-means example
32
SPSS操作-輸出報表資訊
SOM and K-means example
33
SPSS操作-群聚結果製圖
1.選擇“scatter plot”散佈 圖
SOM and K-means example
3
Matlab操作—匯入資料
匯入所需資料:
100個資料點(座標值)
SOM and K-means example
4
Matlab操作—匯入資料(續)
於c101.txt所在位置, 將其匯入
SOM and K-means example
5
Matlab操作—匯入資料(續)
Matlab操作—呼叫類神經網路建構工具
轉置後得到ans檔
於命令列下鍵入“nntool” 以呼叫類神經網路模組
SOM and K-means example
9
Matlab操作—呼叫類神經網路建構工具(續)
選擇“Import”, 將資料ans匯入
SOM and K-means example
10
Matlab操作—呼叫類神經網路建構工具(續)
SOM and K-means example
29
SPSS操作-群聚分析(續)
勾選“匯入檔案”,選擇所設群心的 檔案 (群心檔如右所示)
SOM and K-means example
30
SPSS操作-群聚分析(續)
按下此鈕可選擇是否在表格中另存群聚後的新資料, 選擇後,按continue繼續
SOM and K-means example 31
將 K-means example
11
Matlab操作—呼叫類神經網路建構工具(續)
匯入的資料
待所需資料匯入後, 即可選擇“New Network” ,以建構類神經網路模組
SOM and K-means example 12
Matlab操作—呼叫類神經網路建構工具(續)
確定後,選擇“Export”
SOM and K-means example
21
Matlab操作—呼叫類神經網路建構工具(續)
在命令列輸入 plotsom(network1.iw{1,1},yers{1}.distances)
(輸入繪圖指令將群聚中心點標示出來) hold on(保留圖中的群聚中心點)
群聚分析操作介紹 -以SOM和K-means為例
使用工具:MATLAB 6.1
SPSS11.01
SOM and K-means example
1
SOM操作步驟

資料前置處理 Matlab操作
SOM and K-means example
2
資料前置處理
輸入的資料如文字檔所示 (本例為X,Y座標值)
60
7 6
40
5 4
20
3 2
0 -20
Y
1 0 20 40 60 80 100
X
SOM and K-means example 36
24
SPSS操作-資料的輸入
開啟SPSS後,選擇“Type in data” 選備建立資料
SOM and K-means example
25
SPSS操作-資料的輸入(續)
切換至“variable view” 鍵入所需變數名稱
SOM and K-means example
26
SPSS操作-資料的輸入(續)
相关文档
最新文档