このスキームに従って、インクリメンタル クラスタリング アルゴリズムを使用しています。
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
この場合、この関数はどのように定義できますか? それに対するより良い解決策はありますか?