Bird
0
0

Given the linkage matrix Z = [[0, 1, 0.3, 2], [2, 3, 1.2, 2], [4, 5, 2.1, 4]], what is the output of fcluster(Z, t=1.0, criterion='distance')?

medium📝 Predict Output Q4 of 15
SciPy - Clustering and Distance
Given the linkage matrix Z = [[0, 1, 0.3, 2], [2, 3, 1.2, 2], [4, 5, 2.1, 4]], what is the output of fcluster(Z, t=1.0, criterion='distance')?
A[1 2 2 3]
B[1 1 2 2]
C[1 1 1 1]
D[2 2 3 3]
Step-by-Step Solution
Solution:
  1. Step 1: Understand the linkage matrix

    The matrix shows merges with distances: 0.3, 1.2, and 2.1.
  2. Step 2: Apply distance threshold t=1.0

    Clusters merge if their linkage distance is ≤ 1.0. The first merge (0.3) merges points 0 and 1.
  3. Step 3: Assign cluster labels

    Points 0 and 1 are cluster 1; points 2 and 3 remain separate clusters since their merge distances exceed 1.0.
  4. Final Answer:

    [1 1 2 2] -> Option B
  5. Quick Check:

    Clusters split at distance 1.0 [OK]
Quick Trick: Clusters merge only if linkage distance ≤ threshold [OK]
Common Mistakes:
  • Merging clusters beyond threshold
  • Misreading linkage matrix indices
  • Assigning wrong cluster labels

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes