Clustering as dimensionality reduction