데이터분석/R

[ADP] 혼합분포 군집 (Mixture Distribution Clustering)

버섯도리 2022. 1. 16. 11:42

> # 12. 혼합분포 군집 (Mixture Distribution Clustering)


> # iris dataset에 대해 Mclust() 함수를 통해 군집분석을 수행하면 혼합분포의 모수추정치와 함께 각 군집별 해당 자료에 대한 요약을 확인할 수 있다.
> library(mclust)

> mc <- Mclust(iris[,1:4], G=3)
fitting ...
  |==================================================================================================================| 100%
summary(mc, parameters=TRUE)
---------------------------------------------------- 
Gaussian finite mixture model fitted by EM algorithm 
---------------------------------------------------- 

Mclust VEV (ellipsoidal, equal shape) model with 3 components: 

 log-likelihood   n df       BIC       ICL
       -186.074 150 38 -562.5522 -566.4673

Clustering table:
 1  2  3 
50 45 55 

Mixing probabilities:
        1         2         3 
0.3333333 0.3005423 0.3661243 

Means:
              [,1]     [,2]     [,3]
Sepal.Length 5.006 5.915044 6.546807
Sepal.Width  3.428 2.777451 2.949613
Petal.Length 1.462 4.204002 5.482252
Petal.Width  0.246 1.298935 1.985523

Variances:
[,,1]
             Sepal.Length Sepal.Width Petal.Length Petal.Width
Sepal.Length   0.13320850  0.10938369  0.019191764 0.011585649
Sepal.Width    0.10938369  0.15495369  0.012096999 0.010010130
Petal.Length   0.01919176  0.01209700  0.028275400 0.005818274
Petal.Width    0.01158565  0.01001013  0.005818274 0.010695632
[,,2]
             Sepal.Length Sepal.Width Petal.Length Petal.Width
Sepal.Length   0.22572159  0.07613348   0.14689934  0.04335826
Sepal.Width    0.07613348  0.08024338   0.07372331  0.03435893
Petal.Length   0.14689934  0.07372331   0.16613979  0.04953078
Petal.Width    0.04335826  0.03435893   0.04953078  0.03338619
[,,3]
             Sepal.Length Sepal.Width Petal.Length Petal.Width
Sepal.Length   0.42943106  0.10784274   0.33452389  0.06538369
Sepal.Width    0.10784274  0.11596343   0.08905176  0.06134034
Petal.Length   0.33452389  0.08905176   0.36422115  0.08706895
Petal.Width    0.06538369  0.06134034   0.08706895  0.08663823
plot.Mclust(mc)
Model-based clustering plots: 

1: BIC
2: classification
3: uncertainty
4: density

선택: 2


Model-based clustering plots: 

1: BIC
2: classification
3: uncertainty
4: density

선택: 4

Model-based clustering plots: 

1: BIC
2: classification
3: uncertainty
4: density

선택: 0

 

 

 

 

 

출처 : 2020 데이터 분석 전문가 ADP 필기 한 권으로 끝내기