简体   繁体   English

具有周期性边界条件的DBSCAN python

[英]DBSCAN python with periodic boundary conditions

I'm trying to use sklearn.cluster.DBSCAN sklearn.cluster.DBSCAN for analysis of clusters in a 2D grid. 我正在尝试使用sklearn.cluster.DBSCAN sklearn.cluster.DBSCAN来分析2D网格中的群集。 http://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html#sklearn.cluster.DBSCAN But I have encountered the problem, that clustering across periodic boundary conditions is not implemented. http://scikit-learn.org/stable/modules/generation/sklearn.cluster.DBSCAN.html#sklearn.cluster.DBSCAN但是我遇到了这个问题,即无法实现跨周期性边界条件的聚类。

Does anyone know an implementation that takes periodic boundary conditions into account? 有谁知道考虑周期性边界条件的实现? or how to implement it? 或如何实施?

/ Mikkel C / Mikkel C

DBSCAN does not need to be modified for this. 无需为此修改DBSCAN。

Just roll your own distance function, instead of using Euclidean distance. 只需滚动您自己的距离函数,而不使用欧几里得距离即可。

There you can easily implement your periodic boundary conditions. 在那里,您可以轻松实现您的周期性边界条件。

You can add an extra dimension to enforce periodic boundary conditions. 您可以添加额外的维度以强制执行周期性边界条件。 Say I wanted to use DBSCAN to extract points by their angle (theta) in polar coordinates. 假设我想使用DBSCAN通过极坐标中的角度(θ)提取点。 If I run DBSCAN on [theta], points 1 degree and 359 degrees would not be clustered together. 如果我在θ上运行DBSCAN,则1度和359度的点将不会聚在一起。 However if I run DBSCAN on [sin(theta), cos(theta)], this solves the issue. 但是,如果我在[sinθ,cosθ]上运行DBSCAN,则可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在python中应用具有周期性边界条件的圆形掩模 - Applying circular mask with periodic boundary conditions in python 考虑到数据中的周期性边界条件,如何在python移动平均中应用 - how to apply in python mobile averaging considering periodic boundary conditions in data python中的有效符号函数,用于周期性边界条件的情况 - efficient sign function in python for case of periodic boundary conditions 优化Python距离计算,同时考虑周期性边界条件 - Optimizing Python distance calculation while accounting for periodic boundary conditions 具有周期性边界条件的数据的直方图 - Histogram for data with periodic boundary conditions 具有周期性边界条件的2D插值 - 2D Interpolation with periodic boundary conditions 具有周期边界条件的接触/协调数的计算 - Calculation of Contact/Coordination number with Periodic Boundary Conditions 在 Pyomo 约束中定义循环/周期性边界条件 - Defining cyclic/periodic boundary conditions in Pyomo constraints 在多维网格中实现周期性边界条件 - Implementing periodic boundary conditions in multidimensional grid 具有周期性边界条件的np.ndarray - np.ndarray with Periodic Boundary conditions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM