Web/Python 썸네일형 리스트형 Hierarchical Clustering In [7]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns import pprint %matplotlib inline 성남시 설문응답 결과 중 학생 데이터를 분석해보자. In [4]: import pandas as pd import numpy as np df_all = pd.read_csv('rawdata/pure_vector_28_new.csv', sep=',') labels = list(df_all['member_idx'].values) columns = df_all.columns[1:] d.. DBSCAN clustering In [38]: from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline 성남시 설문응답 결과 중 학생 데이터를 분석해보자. In [2]: import pandas as pd import numpy as np df_all = pd.read_csv('rawdata/pure_vector_28_new.csv', sep=',') labels = list(df_all['member_idx'].values) columns = df_all.columns[1:] df = pd.DataFrame( df_all.loc[:, df_all.colum.. k-means clustering-check In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sn import pprint %matplotlib inline In [2]: from sklearn.cluster import KMeans from sklearn.metrics import silhouette_samples, silhouette_score from sklearn.datasets import make_blobs from collections import Counter class ClusteringManager(object): def __init__(self, rec_uf.. k-means clustering In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sn import pprint %matplotlib inline In [2]: from sklearn.cluster import KMeans from collections import Counter class ClusteringManager(object): def __init__(self, rec_uf_g_idx, factor_limit_cnt=4, k=2): self.rec_uf_g_idx = rec_uf_g_idx self.factor_limit_cnt = factor_limit_c.. 이전 1 다음