我有以下代码来估计DBSCAN的eps
。如果代码没问题,那么我就得到了knn distance plot
。代码是:
ns = 4
nbrs = NearestNeighbors(n_neighbors=ns).fit(data)
distances, indices = nbrs.kneighbors(data)
distanceDec = sorted(distances[:,ns-1], reverse=True)
plt.plot(indices[:,0], distanceDec)
其中data
是像素位置的数组(行和列)。我得到了一个图,但我不知道如何确定eps
。根据DBSCAN
论文
the threshold point is the first point in the first valley of the sorted k-dist graph
我不知道如何在代码中实现它。而且,ns = 4
是我的minPts
还是有什么方法可以从eps
来估计{
使用
你会得到一个肘击图。曲线发生剧烈变化的距离就是epsilon。在
如果愿意,也可以将reverse=False设置为False。在
据我所知,这是由人类通过视觉来确定的。在
自动化似乎不起作用。在
或者你可以用光学仪器。在
相关问题 更多 >
编程相关推荐