scikit-learn AgglomerativeClustering and connectivity -
scikit-learn AgglomerativeClustering and connectivity -
i trying utilize agglomerativeclustering scikit-learn cluster points on place. points defined coordinates (x,y) stored in _xy.
cluster limited few neighbours through connectivity matrix defined c = kneighbors_graph(_xy, n_neighbors = 20).
i want points not part of same cluster, if neighbours, modified connectivity matrix set 0 between these points.
the algorithm runs smoothly but, @ end, clusters contain points should not together, i.e. couple imposed _c = 0.
from children, can see problem arises when cluster of 2 points (i, j) formed , k joins (i,j) if _c[i,k]=0.
so wondering how connectivity constraint propagated when size of clusters larger 2, _c beingness not defined in case.
thanks !
so seems happening in case despite active disconnection of point not want have in 1 cluster, these points still part of same connected component , info associated them still imply should connected same cluster level up.
in general, agglomerativeclustering works follows: @ beginning, info points separate clusters. then, @ each iteration, 2 adjacent clusters merged, such overall increment in discrepancy original info minimal if compare original info cluster means in l2 distance.
hence, although sever direct link between 2 nodes, can clustered 1 level higher intermediate node.
scikit-learn connectivity hierarchical-clustering
Comments
Post a Comment