Clustering and feature allocation