0
0
ML Pythonprogramming~20 mins

Hierarchical clustering in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Hierarchical Clustering Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding linkage methods in hierarchical clustering
Which linkage method in hierarchical clustering merges clusters based on the maximum distance between points in the two clusters?
AAverage linkage
BSingle linkage
CComplete linkage
DWard linkage
Attempts:
2 left
Predict Output
intermediate
2:00remaining
Output of dendrogram linkage matrix
What is the output of the following Python code snippet using scipy for hierarchical clustering linkage matrix?
ML Python
from scipy.cluster.hierarchy import linkage
import numpy as np
X = np.array([[1, 2], [3, 4], [5, 6]])
Z = linkage(X, method='single')
print(Z)
A
[[0. 1. 2.82842712 2.]
 [2. 3. 4.24264069 2.]
 [4. 5. 5.65685425 3.]]
B
[[0. 1. 2.82842712 2.]
 [2. 3. 2.82842712 2.]
 [4. 5. 4.24264069 3.]]
C
[[0. 1. 2.82842712 2.]
 [2. 3. 2.82842712 2.]
 [4. 5. 5.65685425 3.]]
D
[[0. 1. 1.41421356 2.]
 [2. 3. 2.82842712 2.]
 [4. 5. 4.24264069 3.]]
Attempts:
2 left
Model Choice
advanced
2:00remaining
Choosing hierarchical clustering for data type
Which type of dataset is hierarchical clustering most suitable for compared to k-means clustering?
AData with non-globular clusters and unknown number of clusters
BHigh-dimensional sparse data with many irrelevant features
CLarge datasets with millions of samples
DData with clearly separated spherical clusters and known cluster count
Attempts:
2 left
Hyperparameter
advanced
2:00remaining
Effect of distance metric on hierarchical clustering
How does changing the distance metric from Euclidean to Manhattan affect hierarchical clustering results?
AChanging distance metric only affects k-means, not hierarchical clustering
BClusters will always be identical regardless of distance metric
CManhattan distance causes hierarchical clustering to fail with an error
DClusters may differ because Manhattan distance measures distance along axes, affecting cluster shape
Attempts:
2 left
Metrics
expert
2:00remaining
Interpreting cophenetic correlation coefficient
What does a cophenetic correlation coefficient close to 1 indicate about a hierarchical clustering result?
AThe clustering perfectly preserves the pairwise distances between original points
BThe clustering poorly represents the original data distances
CThe clustering has exactly one cluster containing all points
DThe clustering uses single linkage method
Attempts:
2 left