9

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

Yahia
  • 1,209
  • 1
  • 15
  • 18
  • A similar question has been answered here: http://stackoverflow.com/questions/17817889/is-there-any-way-to-add-points-to-kd-tree-implementation-in-scipy – Bill Mar 02 '16 at 04:51
  • 1
    Possible duplicate of [Is there any way to add points to KD tree implementation in Scipy](https://stackoverflow.com/questions/17817889/is-there-any-way-to-add-points-to-kd-tree-implementation-in-scipy) – crypdick Jul 13 '18 at 21:16

0 Answers0