赞
踩
- clear
- clc
-
- disp 'Loading...'
- feature_list = csvread('feature_list.csv');
- disp 'scaling...'
- feature_z = zscore(feature_list);
-
-
- GMM_3 = fitgmdist(feature_z, 3, 'RegularizationValue', 0.1);
- disp 'GMM 3 aic/bic and alpha:', GMM_3.AIC, GMM_3.BIC, GMM_3.ComponentProportion
- GMM_4 = fitgmdist(feature_z, 4, 'RegularizationValue', 0.1);
- disp 'GMM 4 aic/bic and alpha:', GMM_4.AIC, GMM_4.BIC, GMM_4.ComponentProportion
- GMM_5 = fitgmdist(feature_z, 5, 'RegularizationValue', 0.1);
- disp 'GMM 5 aic/bic and alpha:', GMM_5.AIC, GMM_5.BIC, GMM_5.ComponentProportion
- GMM_6 = fitgmdist(feature_z, 6, 'RegularizationValue', 0.1);
- disp 'GMM 6 aic/bic and alpha:', GMM_6.AIC, GMM_6.BIC, GMM_6.ComponentProportion
- GMM_7 = fitgmdist(feature_z, 7, 'RegularizationValue', 0.1);
- disp 'GMM 7 aic/bic and alpha:', GMM_7.AIC, GMM_7.BIC, GMM_7.ComponentProportion
- GMM_8 = fitgmdist(feature_z, 8, 'RegularizationValue', 0.1);
- disp 'GMM 8 aic/bic and alpha:', GMM_8.AIC, GMM_8.BIC, GMM_8.ComponentProportion
- GMM_9 = fitgmdist(feature_z, 9, 'RegularizationValue', 0.1);
- disp 'GMM 9 aic/bic and alpha:', GMM_9.AIC, GMM_9.BIC, GMM_9.ComponentProportion
- GMM_10 = fitgmdist(feature_z, 10, 'RegularizationValue', 0.1);
- disp 'GMM 10 aic/bic and alpha:', GMM_10.AIC, GMM_10.BIC, GMM_10.ComponentProportion
-
- aics = [GMM_3.AIC GMM_4.AIC GMM_5.AIC GMM_6.AIC GMM_7.AIC GMM_8.AIC GMM_9.AIC GMM_10.AIC ];
- bics = [GMM_3.BIC GMM_4.BIC GMM_5.BIC GMM_6.BIC GMM_7.BIC GMM_8.BIC GMM_9.BIC GMM_10.BIC ];
- min_aic_index = find(aics==min(aics));
- min_bic_index = find(bics==min(bics));
- disp 'min aic/bic cluster num:', min_aic_index, min_bic_index
-
-
- id_4 = cluster(GMM_4, feature_z);
- csvwrite('id_4.txt', id_4);
-
- id_5 = cluster(GMM_5, feature_z);
- csvwrite('id_5.txt', id_5);
-
- id_6 = cluster(GMM_6, feature_z);
- csvwrite('id_6.txt', id_6);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。