from sklearn.mixture import GaussianMixturen_components = 4 # 분포 개수random_state = 10 # 모델 고정model = GaussianMixture(n_components=n_components, random_state=random_state)# GMM 모델 학습model.fit(df)df['gmm_label'] = model.predict(df)# 시각화sns.scatterplot(x=df[0], y=df[1], hue=df['gmm_label'], palette='rainbow', alpha=0.7, s=100)계층 기반 클러스터링: 유사한 데이터를 묶은 클러스터들을 층으로 쌓아가며 클러스터링 하는 방식데이터간 관계를 쉽게 파악할 ..