Một số kết quả chạy chương trỡnh trờn số liệu cú cấu trỳc như bảng 1. Bộ dữ liệu được lấy ngẫu nhiờn từ chương trỡnh quản lý thụng tin khỏch hàng (gồm 150 khỏch hàng).
% BUOC 1: DOC DU LIEU TU FILE % ====================== try,
sD = som_read_datắcustbank4.datỏ); data read ok
end
% BUOC 2: XU LY DU LIEU % ========================== sD = som_normalize(sD,'var'); x = sD.dată1,:) x = 0.7042 -0.1638 -0.9779 0.8998 -0.3327 -0.0307 2.6831 1.6677 orig_x = som_denormalize(x,sD) orig_x = 2.5000 4.3000 30.0000 4.2000 40.0000 6.5000 15.0000 1.0000
% BUOC 3: HUAN LUYEN DU LIEU % ====================
sM = som_make(sD); Determining map sizẹ.. kich thuoc cua dlen: 150 kich thuoc cua munits: 62 kich thuoc cua munits: 62 kich thuoc cua sTopol.msize: 8 kich thuoc cua sTopol.msize: 8 map size [11, 6]
Initialization...
kich thuoc cua munits: 100 kich thuoc cua sTopol.msize: 10 kich thuoc cua sTopol.msize: 10 Training using batch algorithm... Rough training phasẹ..
kich thuoc cua munits: 66 kich thuoc cua dlen: 150
kich thuoc cua mpd: 4.400000e-001 kich thuoc cua traninlen: 5 Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Finetuning phasẹ..
kich thuoc cua munits: 66 kich thuoc cua dlen: 150
kich thuoc cua mpd: 4.400000e-001 kich thuoc cua traninlen: 18 Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s Training: 0/ 0 s
Final quantization error: 1.071 Final topographic error: 0.033
% ===================================================== colormap(1-gray)
som_show(sMap,'norm','d')
% BUOC 4: TRUC QUAN HOA SELF-ORGANIZING MAP: SOM_SHOW % ===================================================== h=zeros(sMap.topol.msize); h(1,2) = 1;
som_show_ađ('hit',h(:),'markercolor','r','markersizộ,0.5,'subplot','all')
% BUOC 4: TRUC QUAN HOA SELF-ORGANIZING MAP: SOM_SHOW % ===================================================== som_show(sMap,'umat','all','emptý,'Labels')
Kết quả trờn cho thấy thụng tin khỏch hàng sử dụng cụng cụ SOM ToolBox cú 03 cụm:
Cụm 1: cú khỏch hàng BR
Cụm 2: gồm cỏc khỏch hàng A, D, FA, CE, B, CA, BD, CH, BA, CD, BN, BC, CK,
CS, BJ.
Cụm 3: gồm cỏc khỏch hàng AL, AW, AX, CB, AP, AV, DO, AQ, CZ, CP, BF, BY, T, AJ, EQ, X, AH, CM, BE, H, P, CN, CL, BQ, J, S, BW, BM, CX, CỤ % BUOC 4: TRUC QUAN HOA SELF-ORGANIZING MAP: SOM_SHOW
% =====================================================
som_show_ađ('label',sMap,'Textsizộ,8,'TextColor','r','Subplot',2)
% STEP5: CLUSTERING OF THE MAP % =====================
sM = som_autolabel(sM,sD,'votộ); kich thuoc cua bmu: 150
kich thuoc cua Labels: 66
subplot(1,3,1)
[c,p,err,ind] = kmeans_clusters(sM, 7); %Chia SOM thành 07 cum n_max: 7
c_max: 5
plot(1:length(ind),ind,'x-') [dummy,i] = min(ind)
dummy = 0.7652
i = 5 %So cum co duoc tu thuat toỏn
subplot(1,3,2)
[Pd,V,me,l] = pcaproj(sD,2); Pm = pcaproj(sM,V,me); Code = som_colorcode(Pm); hits = som_hits(sM,sD); U = som_umat(sM); Dm = U(1:2:size(U,1),1:2:size(U,2)); Dm = 1-Dm(:)/max(Dm(:)); Dm(find(hits==0)) = 0; som_cplane(sM,Code,Dm); subplot(1,3,3) som_cplane(sM,cl)