_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › DBSCAN
|
|
[edit]
1 螳 #DBSCAN(min_sample, eps) 蟲一 螻襴讀願, 襷り覲螳 2螳.
[edit]
2 ##two_moon 一危 from sklearn.datasets import make_moons import pandas as pd X, y = make_moons(n_samples=200, noise=0.05, random_state=0) df = pd.DataFrame(X, columns=["x", "y"]) df["group"] = y df[:5] #import matplotlib.pyplot as plt #plt.scatter(x=df.x, y=df.y, c=df.group) #<scatter plot>: 蠍磯 import matplotlib.pyplot as plt plt.scatter(x=df.x, y=df.y, c=df.group) fig, ax = plt.subplots() colors = {1:'red', 0:'blue'} grouped = df.groupby('group') for key, group in grouped: group.plot(ax=ax, kind='scatter', x='x', y='y', label=key, color=colors[key]) plt.show() #</scatter plot>: 蠍郁讌 覯 ろ #譴(蠏=0, 覿=1) from sklearn.preprocessing import StandardScaler scale = StandardScaler() scale.fit(df[["x", "y"]]) scaled_X = scale.transform(df[["x", "y"]]) df["scaled_x"] = scaled_X[:,0] df["scaled_y"] = scaled_X[:,1] #DBSCAN from sklearn.cluster import DBSCAN dbscan = DBSCAN(eps=0.5, min_samples=5) #蠍磯蓋螳企. cluster = dbscan.fit_predict(scaled_X) df["cluster"] = cluster #clustering 蟆郁骸 plt.scatter(x=df.scaled_x, y=df.scaled_y, c=df.cluster) plt.xlabel("x") plt.ylabel("y") 蟆郁骸
[edit]
3 谿瑚 #
鏤
|
蟲 覈詩 讌襷 蟲 讌 蟆 . 蠏碁 讌ろ 襴れ 覓伎螻朱 覦蠖 給. 讌 蟆語願 れ 蠍一. 覈詞朱 覿讌 蟆 讌朱 蟇伎ろる 企 蟆 螳誤 給. 螳 一渚 讌 朱 螳 襦 覈旧 覲 螻 襷 給. |