how to add/remove data points to/from a scikit-learn KD-Tree?

╄→гoц情女王★ 提交于 2019-12-22 09:51:48

问题


I am wondering if it is possible to add or remove data points from a scikit-lern KD-Tree instance after its creation ?

For example:

from sklearn.neighbors import KDTree
import numpy as np
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
kdt = KDTree(X, leaf_size=30, metric='euclidean')

'''
Do another stuff

'''
# Then, I want to add [8,3] point to kdt without rebuilding it again
# How to remove [-2,-1] from kdt ?

I did not find such information in the KD-Tree documentation

来源:https://stackoverflow.com/questions/28002093/how-to-add-remove-data-points-to-from-a-scikit-learn-kd-tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!