I have implemented two type of clustering in python, using SciPy: one with hierarchical approach, and the other one with k-means.In each cases I have used as input a two dimensional array X (documents, binary features) of 628 * 492.#Hierarchical:Z = linkage(X, 'ward')clusters = fcluster(Z, max_k, criterion='maxclust').tolist()#k-means:clusters = kmeans2(X, k, iter_, minit=points)[1].tolist()In the first case (hierarchical one) I got an array of size 628 (an array which the i-th element is the i-th document associate cluster) In the second one I got an array of size 627. Why?I got also this warning in the k-means execution (using different values for k):/usr/lib/python3/dist-packages/scipy/cluster/vq.py:600: UserWarning: One of the clusters is empty. Re-run kmean with a different initialization.warnings.warn(One of the clusters is empty. The cluster empty is the one associate to the missing document? If the document missing would be in the middle of the list this situation wouldn't led to incoherent results? (list indexing wrong)
k-means python implementation: unclear\wrong result
python;clustering;k means