Implement sample_majority for clustering