An unsupervised alternating clustering method