Kmeans1 12. KMeans 1. Clusters(클러스터)유사한 특성을 가진 개체들의 집합고객 분류, 유전자 분석, 이미지 분할import numpy as npimport pandas as pdimport seaborn as snsimport matplotlib.pyplot as pltfrom sklearn.datasets import make_blobsX, y = make_blobs(n_samples=100, centers=3, random_state=2023)X=pd.DataFrame(X)Xysns.scatterplot(x=X[0], y=X[1], hue=y)from sklearn.cluster import KMeanskm = KMeans(n_clusters=3)km.fit(X)pred = km.predict(X)sns.sca.. 2024. 6. 13. 이전 1 다음