Bird
0
0

You have a linkage matrix Z from hierarchical clustering of 12 points. You want to form exactly 4 clusters. Which fcluster call correctly achieves this?

hard📝 Application Q8 of 15
SciPy - Clustering and Distance
You have a linkage matrix Z from hierarchical clustering of 12 points. You want to form exactly 4 clusters. Which fcluster call correctly achieves this?
A<code>fcluster(Z, t=4, criterion='maxclust')</code>
B<code>fcluster(Z, t=4, criterion='distance')</code>
C<code>fcluster(Z, t=3, criterion='maxclust')</code>
D<code>fcluster(Z, t=3, criterion='distance')</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'maxclust' criterion

    Using criterion='maxclust' with t set to the desired number of clusters returns exactly that many clusters.
  2. Step 2: Differentiate from 'distance'

    Using criterion='distance' cuts the dendrogram at a distance threshold, which may not yield the exact number of clusters.
  3. Step 3: Choose correct call

    To get exactly 4 clusters, use fcluster(Z, t=4, criterion='maxclust').
  4. Final Answer:

    fcluster(Z, t=4, criterion='maxclust') -> Option A
  5. Quick Check:

    maxclust with t=number of clusters [OK]
Quick Trick: Use criterion='maxclust' with t=desired clusters [OK]
Common Mistakes:
  • Using 'distance' criterion to get exact cluster count
  • Setting t incorrectly for maxclust
  • Confusing t parameter meaning

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes