我有以下这个方案的增量聚类算法:增量层次结构
Let x a new data-point, and c the centroid that is closest from x
if(distance(x, c) > threshold)
x becomes a new cluster center (i.e. a new centroid)
else assign x to c (i.e. update the centroid by taking x)
为了加快从X最接近中心的搜索,我想有中心的分层结构(使用一棵树),我们可以在每次考虑一个新的数据点时增量更新。
树的每个内部节点都表示为该节点下的质心的平均值。当更新一个给定的质心(因为一个新的数据点被分配给这个质心),我们应该重建所有高于这个质心的节点。
这样的算法变成类似:
Let x a new data-point
c = searchClosestCenter(x, tree) // return the centroid closest to x
if(distance(x, c) > threshold)
x becomes a new cluster center (i.e. a new centroid)
AddCenterToTree(x, tree)
else
assign x to c (i.e. update the centroid by taking x)
UpdateTree(c) // update all nodes that are on top of c
怎么可以这样的功能在这种情况下如何界定?有没有更好的解决方案?
好吧,但R树增量(即允许我添加/更新/删除叶子,而不重建整个层次结构)?目前还不清楚如何在我的案例中使用它(请参阅我的第二个算法描述),我已经在C++中找到了一个实现(这对我来说很方便),但是看看我需要调用哪些函数并不简单,根据我的算法。 – shn
这是我发现在单个头文件RTree.h中实现的C++实现:http://superliminal.com/sources/RTreeTemplate.zip – shn
是的,R-tree是一种自我平衡树,专为变化而设计。 –