当前位置:   article > 正文

MATLAB GMM_gmm的matlab代码

gmm的matlab代码
  1. clear
  2. clc
  3. disp 'Loading...'
  4. feature_list = csvread('feature_list.csv');
  5. disp 'scaling...'
  6. feature_z = zscore(feature_list);
  7. GMM_3 = fitgmdist(feature_z, 3, 'RegularizationValue', 0.1);
  8. disp 'GMM 3 aic/bic and alpha:', GMM_3.AIC, GMM_3.BIC, GMM_3.ComponentProportion
  9. GMM_4 = fitgmdist(feature_z, 4, 'RegularizationValue', 0.1);
  10. disp 'GMM 4 aic/bic and alpha:', GMM_4.AIC, GMM_4.BIC, GMM_4.ComponentProportion
  11. GMM_5 = fitgmdist(feature_z, 5, 'RegularizationValue', 0.1);
  12. disp 'GMM 5 aic/bic and alpha:', GMM_5.AIC, GMM_5.BIC, GMM_5.ComponentProportion
  13. GMM_6 = fitgmdist(feature_z, 6, 'RegularizationValue', 0.1);
  14. disp 'GMM 6 aic/bic and alpha:', GMM_6.AIC, GMM_6.BIC, GMM_6.ComponentProportion
  15. GMM_7 = fitgmdist(feature_z, 7, 'RegularizationValue', 0.1);
  16. disp 'GMM 7 aic/bic and alpha:', GMM_7.AIC, GMM_7.BIC, GMM_7.ComponentProportion
  17. GMM_8 = fitgmdist(feature_z, 8, 'RegularizationValue', 0.1);
  18. disp 'GMM 8 aic/bic and alpha:', GMM_8.AIC, GMM_8.BIC, GMM_8.ComponentProportion
  19. GMM_9 = fitgmdist(feature_z, 9, 'RegularizationValue', 0.1);
  20. disp 'GMM 9 aic/bic and alpha:', GMM_9.AIC, GMM_9.BIC, GMM_9.ComponentProportion
  21. GMM_10 = fitgmdist(feature_z, 10, 'RegularizationValue', 0.1);
  22. disp 'GMM 10 aic/bic and alpha:', GMM_10.AIC, GMM_10.BIC, GMM_10.ComponentProportion
  23. 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 ];
  24. 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 ];
  25. min_aic_index = find(aics==min(aics));
  26. min_bic_index = find(bics==min(bics));
  27. disp 'min aic/bic cluster num:', min_aic_index, min_bic_index
  28. id_4 = cluster(GMM_4, feature_z);
  29. csvwrite('id_4.txt', id_4);
  30. id_5 = cluster(GMM_5, feature_z);
  31. csvwrite('id_5.txt', id_5);
  32. id_6 = cluster(GMM_6, feature_z);
  33. csvwrite('id_6.txt', id_6);

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/920114
推荐阅读
相关标签
  

闽ICP备14008679号