extract_clusters function

Find and extract clusters from a dataset