머신러닝 - KMeans 파이썬 소스 코드


머신러닝 - KMeans 파이썬 소스 코드

scikit-learn 라이브러리를 사용하여 파이썬에서 k-means 클러스터링에 관한 소스 코드 입니다. import numpy as np from sklearn.cluster import KMeans import matplotlib.pyplot as plt # generate sample data np.random.seed(0) X = np.random.randn(100, 2) # create k-means object with 3 clusters kmeans = KMeans(n_clusters=3, random_state=0) # fit k-means model to data kmeans.fit(X) # get cluster labels and centers labels = kmeans.labels_ centers = kmeans.cluster_centers_ # plot data points and cluster centers plt.scatter(X[:, 0], X[:, 1...


#KMeans #군집분석 #머신러닝 #비계층적

원문링크 : 머신러닝 - KMeans 파이썬 소스 코드