Data Science with Python Certification Data Science with Python Unsupervised Learning Algorithms 3 — Questions and Answers
Question 1: What is the primary purpose of the elbow method in K-Means clustering?
- Selecting the optimal number of clusters by identifying the point of diminishing returns in inertia (Correct answer)
- Removing outlier clusters automatically
- Initializing centroids more effectively
- Measuring cluster purity against ground truth
Correct answer: Selecting the optimal number of clusters by identifying the point of diminishing returns in inertia
The elbow method plots inertia vs. k and looks for the 'elbow' where adding more clusters yields minimal improvement.
Question 2: What is the key assumption of the Gaussian Mixture Model (GMM)?
- Data is generated from a mixture of Gaussian distributions (Correct answer)
- All clusters have equal covariance
- Data must be standardized before fitting
- The number of components equals the number of features
Correct answer: Data is generated from a mixture of Gaussian distributions
GMM assumes each data point is generated from one of several Gaussian distributions with unknown parameters.
Question 3: Which step in the Expectation-Maximization (EM) algorithm computes the probability of each point belonging to each cluster?
- E-step (Expectation) (Correct answer)
- M-step (Maximization)
- Initialization step
- Convergence check step
Correct answer: E-step (Expectation)
The E-step computes posterior probabilities (responsibilities) of cluster membership for each data point.
Question 4: In scikit-learn, which parameter of `KMeans` controls the number of times the algorithm runs with different centroid seeds?
- n_init (Correct answer)
- max_iter
- n_clusters
- random_state
Correct answer: n_init
`n_init` specifies how many times K-Means is run with different centroid seeds; the best result is kept.
Question 5: What is 'whitening' in the context of PCA preprocessing?
- Scaling principal components to have unit variance (Correct answer)
- Centering data to zero mean
- Removing the smallest principal components
- Rotating the feature space arbitrarily
Correct answer: Scaling principal components to have unit variance
Whitening divides each principal component by its standard deviation so all components have unit variance.
Question 6: Which metric is used to evaluate clustering quality without ground-truth labels?
- Silhouette score (Correct answer)
- Accuracy
- F1-score
- ROC-AUC
Correct answer: Silhouette score
The silhouette score measures how similar a point is to its own cluster versus other clusters, requiring no labels.
Question 7: In UMAP, what does the `min_dist` parameter control?
- How tightly points are packed in the low-dimensional embedding (Correct answer)
- The number of nearest neighbors
- The number of output dimensions
- The learning rate
Correct answer: How tightly points are packed in the low-dimensional embedding
`min_dist` controls the minimum distance between points in the embedding; smaller values create tighter clusters.
What is the primary purpose of the elbow method in K-Means clustering?