在sk学习中实现KD Tree

时间:2017-05-27 13:57:02

标签: scikit-learn kdtree

我很好奇kd-tree是如何在sk中构建的。我已经在网上查找了kdtree但不幸的是它不能实现,因为在Sklearn的KD Tree中有一个方法quer_range sk KDtree而没有。有没有我可以查找代码的网站?

1 个答案:

答案 0 :(得分:2)

它分裂了多个文件。

在链接文件的开头,您将看到:

cdef class KDTree(BinaryTree)

意思是,它继承自BinaryTree,定义function you mentioned

此(BinaryTree)文件中还有一些注释:

# Implementation Notes
# --------------------
# This implementation uses the common object-oriented approach of having an
# abstract base class which is extended by the KDTree and BallTree
# specializations.
#
# The BinaryTree "base class" is defined here and then subclassed in the BallTree
# and KDTree pyx files. These files include implementations of the
# "abstract" methods.

因此,在这个链接到的特殊文件中,定义了一些抽象方法,这些方法足以使query_radius - 方法从基类工作。

相关问题