Scipy cKDTree query_pairs 对比 query_ball_tree
Scipy cKDTree query_pairs versus query_ball_tree
我对 Scipy
的 cKDTree 的 query_pairs
和 query_ball_tree
方法之间的 differences/similarities 有点困惑。
阅读 docs 可以看出它们具有相同的描述:
query_ball_tree(self, other, r[, p, eps]) - Find all pairs of points whose distance is at most r
query_pairs(self, r[, p, eps]) - Find all pairs of points whose distance is at most r.
它们甚至需要相同的 强制性 参数,除了 query_ball_tree
要求 other
是(来自 docs):"The tree containing points to search against."。
那么,这两种方法之间有实际区别吗?是否更喜欢使用其中一种? 我目前使用 query_pairs
用于我的目的,但我正在考虑替代它。
我看到人们使用前者,比如 tree1.query_ball_tree(tree2, ...)
,这表明你可以在不同的树之间查询......但我 猜测 它是等价的如果我们做了 tree1.query_ball_tree(tree1, ...)
之类的事情,到 query_pairs
。非常感谢任何指导。
query_ball_tree
找到 self
和 other
之间距离最大为 r.
的所有点对
query_pairs
找到 self
中距离最大为 r.
的所有点对
这些新的官方文档可能会对您有所帮助:
scipy.spatial.cKDTree.query_ball_tree — SciPy v1.6.0.dev 参考指南 http://scipy.github.io/devdocs/generated/scipy.spatial.cKDTree.query_ball_tree.html#scipy.spatial.cKDTree.query_ball_tree
scipy.spatial.cKDTree.query_pairs — SciPy v1.6.0.dev 参考指南 http://scipy.github.io/devdocs/generated/scipy.spatial.cKDTree.query_pairs.html#scipy.spatial.cKDTree.query_pairs
我对 Scipy
的 cKDTree 的 query_pairs
和 query_ball_tree
方法之间的 differences/similarities 有点困惑。
阅读 docs 可以看出它们具有相同的描述:
query_ball_tree(self, other, r[, p, eps]) - Find all pairs of points whose distance is at most r query_pairs(self, r[, p, eps]) - Find all pairs of points whose distance is at most r.
它们甚至需要相同的 强制性 参数,除了 query_ball_tree
要求 other
是(来自 docs):"The tree containing points to search against."。
那么,这两种方法之间有实际区别吗?是否更喜欢使用其中一种? 我目前使用 query_pairs
用于我的目的,但我正在考虑替代它。
我看到人们使用前者,比如 tree1.query_ball_tree(tree2, ...)
,这表明你可以在不同的树之间查询......但我 猜测 它是等价的如果我们做了 tree1.query_ball_tree(tree1, ...)
之类的事情,到 query_pairs
。非常感谢任何指导。
query_ball_tree
找到 self
和 other
之间距离最大为 r.
query_pairs
找到 self
中距离最大为 r.
这些新的官方文档可能会对您有所帮助:
scipy.spatial.cKDTree.query_ball_tree — SciPy v1.6.0.dev 参考指南 http://scipy.github.io/devdocs/generated/scipy.spatial.cKDTree.query_ball_tree.html#scipy.spatial.cKDTree.query_ball_tree
scipy.spatial.cKDTree.query_pairs — SciPy v1.6.0.dev 参考指南 http://scipy.github.io/devdocs/generated/scipy.spatial.cKDTree.query_pairs.html#scipy.spatial.cKDTree.query_pairs