Skip to main content
Commonmark migration
Source Link

It really depends on your data. From the website you showed, the clusters are don't have the same structure as the ring.

From [review paper on DBSCAN][1]review paper on DBSCAN:

  1. The model introduced by DBSCAN uses a simple minimum density level estimation, based on a threshold for the number of neighbors, minPts, within the radius ε (with an arbitrary distance measure).

  2. Objects with more than minPts neighbors within this radius (including the query point) are considered to be a core point. The intuition of DBSCAN is to find those areas, which satisfy this minimum density, and which are separated by areas of lower density.

  3. All neighbors within the ε radius of a core point are considered to be part of the same cluster as the core point (called direct density reachable). If any of these neighbors is again a core point, their neighborhoods are transitively included (density reachable).

So with a lower eps, it has no problem finding the inner ring. If you want to capture the outer ring, it's a matter of finding the distance that allows the core points of in the outer to be connected:

import seaborn as sns
fig, axs = plt.subplots(2, 3,figsize = (12,6))
axs = axs.reshape(-1)
EPS = [0.08,0.1,0.12,0.14,0.16,0.18]
for i in range(len(EPS)):
    db = DBSCAN(eps=EPS[i],min_samples=5).fit(X)
    labels = db.labels_
    sns.scatterplot(x=X[:,0],y=X[:,1],ax=axs[i],hue=pd.Categorical(labels))
    axs[i].set_title("eps = "+str(EPS[i]))
    axs[i].legend(loc='upper right', ncol=3,prop={'size': 6})

[![enter image description here][2]][2]enter image description here

So we can see that as we increase eps, the members of the outer rings are connected. In this example, most likely something like 0.14 would work (you have some unassigned). [1]: http://www.ccs.neu.edu/home/vip/teach/DMcourse/2_cluster_EM_mixt/notes_slides/revisitofrevisitDBSCAN.pdf [2]: https://i.sstatic.net/a3Whc.png

It really depends on your data. From the website you showed, the clusters are don't have the same structure as the ring.

From [review paper on DBSCAN][1]:

  1. The model introduced by DBSCAN uses a simple minimum density level estimation, based on a threshold for the number of neighbors, minPts, within the radius ε (with an arbitrary distance measure).

  2. Objects with more than minPts neighbors within this radius (including the query point) are considered to be a core point. The intuition of DBSCAN is to find those areas, which satisfy this minimum density, and which are separated by areas of lower density.

  3. All neighbors within the ε radius of a core point are considered to be part of the same cluster as the core point (called direct density reachable). If any of these neighbors is again a core point, their neighborhoods are transitively included (density reachable).

So with a lower eps, it has no problem finding the inner ring. If you want to capture the outer ring, it's a matter of finding the distance that allows the core points of in the outer to be connected:

import seaborn as sns
fig, axs = plt.subplots(2, 3,figsize = (12,6))
axs = axs.reshape(-1)
EPS = [0.08,0.1,0.12,0.14,0.16,0.18]
for i in range(len(EPS)):
    db = DBSCAN(eps=EPS[i],min_samples=5).fit(X)
    labels = db.labels_
    sns.scatterplot(x=X[:,0],y=X[:,1],ax=axs[i],hue=pd.Categorical(labels))
    axs[i].set_title("eps = "+str(EPS[i]))
    axs[i].legend(loc='upper right', ncol=3,prop={'size': 6})

[![enter image description here][2]][2]

So we can see that as we increase eps, the members of the outer rings are connected. In this example, most likely something like 0.14 would work (you have some unassigned). [1]: http://www.ccs.neu.edu/home/vip/teach/DMcourse/2_cluster_EM_mixt/notes_slides/revisitofrevisitDBSCAN.pdf [2]: https://i.sstatic.net/a3Whc.png

It really depends on your data. From the website you showed, the clusters are don't have the same structure as the ring.

From review paper on DBSCAN:

  1. The model introduced by DBSCAN uses a simple minimum density level estimation, based on a threshold for the number of neighbors, minPts, within the radius ε (with an arbitrary distance measure).

  2. Objects with more than minPts neighbors within this radius (including the query point) are considered to be a core point. The intuition of DBSCAN is to find those areas, which satisfy this minimum density, and which are separated by areas of lower density.

  3. All neighbors within the ε radius of a core point are considered to be part of the same cluster as the core point (called direct density reachable). If any of these neighbors is again a core point, their neighborhoods are transitively included (density reachable).

So with a lower eps, it has no problem finding the inner ring. If you want to capture the outer ring, it's a matter of finding the distance that allows the core points of in the outer to be connected:

import seaborn as sns
fig, axs = plt.subplots(2, 3,figsize = (12,6))
axs = axs.reshape(-1)
EPS = [0.08,0.1,0.12,0.14,0.16,0.18]
for i in range(len(EPS)):
    db = DBSCAN(eps=EPS[i],min_samples=5).fit(X)
    labels = db.labels_
    sns.scatterplot(x=X[:,0],y=X[:,1],ax=axs[i],hue=pd.Categorical(labels))
    axs[i].set_title("eps = "+str(EPS[i]))
    axs[i].legend(loc='upper right', ncol=3,prop={'size': 6})

enter image description here

So we can see that as we increase eps, the members of the outer rings are connected. In this example, most likely something like 0.14 would work (you have some unassigned).

Source Link
StupidWolf
  • 5.2k
  • 3
  • 14
  • 28

It really depends on your data. From the website you showed, the clusters are don't have the same structure as the ring.

From [review paper on DBSCAN][1]:

  1. The model introduced by DBSCAN uses a simple minimum density level estimation, based on a threshold for the number of neighbors, minPts, within the radius ε (with an arbitrary distance measure).

  2. Objects with more than minPts neighbors within this radius (including the query point) are considered to be a core point. The intuition of DBSCAN is to find those areas, which satisfy this minimum density, and which are separated by areas of lower density.

  3. All neighbors within the ε radius of a core point are considered to be part of the same cluster as the core point (called direct density reachable). If any of these neighbors is again a core point, their neighborhoods are transitively included (density reachable).

So with a lower eps, it has no problem finding the inner ring. If you want to capture the outer ring, it's a matter of finding the distance that allows the core points of in the outer to be connected:

import seaborn as sns
fig, axs = plt.subplots(2, 3,figsize = (12,6))
axs = axs.reshape(-1)
EPS = [0.08,0.1,0.12,0.14,0.16,0.18]
for i in range(len(EPS)):
    db = DBSCAN(eps=EPS[i],min_samples=5).fit(X)
    labels = db.labels_
    sns.scatterplot(x=X[:,0],y=X[:,1],ax=axs[i],hue=pd.Categorical(labels))
    axs[i].set_title("eps = "+str(EPS[i]))
    axs[i].legend(loc='upper right', ncol=3,prop={'size': 6})

[![enter image description here][2]][2]

So we can see that as we increase eps, the members of the outer rings are connected. In this example, most likely something like 0.14 would work (you have some unassigned). [1]: http://www.ccs.neu.edu/home/vip/teach/DMcourse/2_cluster_EM_mixt/notes_slides/revisitofrevisitDBSCAN.pdf [2]: https://i.sstatic.net/a3Whc.png