小编Yeh*_*ter的帖子

如何在 scikit-learn KD-Tree 中添加/删除数据点?

我想知道是否可以在创建后从 scikit-lern KD-Tree 实例中添加或删除数据点?

例如:

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 ?
Run Code Online (Sandbox Code Playgroud)

我在KD-Tree文档中没有找到此类信息

python kdtree scipy python-3.x scikit-learn

6
推荐指数
0
解决办法
2784
查看次数

标签 统计

kdtree ×1

python ×1

python-3.x ×1

scikit-learn ×1

scipy ×1