반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

sklearn.cluster.DBSCAN 본문

[AI]/python.sklearn

sklearn.cluster.DBSCAN

givemebro 2020. 4. 21. 12:39
반응형

https://broscoding.tistory.com/165

 

머신러닝.sklearn.datasets.make_moons

from sklearn.datasets import make_moons X,y=make_moons(noise=0.1) plt.scatter(X[:,0],X[:,1],c=y)

broscoding.tistory.com

import numpy as np
import matplotlib.pyplot as plt

 

from sklearn.datasets import make_blobs,make_circles,make_moons

X,y=make_moons(noise=0.07,random_state=1)

plt.scatter(X[:,0],X[:,1],c=y,cmap='Reds')

from sklearn.cluster import DBSCAN

dbscan=DBSCAN(min_samples=3,eps=0.3)# min_samples = 3(반경안에 들어오는 셈플 수)
dbscan.fit(X)

plt.scatter(X[:,0],X[:,1],c=dbscan.labels_)
plt.colorbar()

from sklearn.cluster import DBSCAN

dbscan=DBSCAN(min_samples=9,eps=0.3) # min_samples = 9(반경안에 들어오는 셈플 수)
dbscan.fit(X)

plt.scatter(X[:,0],X[:,1],c=dbscan.labels_)
plt.colorbar()

반응형
Comments