MS-DS Master of Data science Unsupervised Machine Learning Models 5 — Questions and Answers
Question 1: When applying k-means to categorical data, which variant is the appropriate alternative?
- k-modes, which uses mode instead of mean and Hamming-based dissimilarity (Correct answer)
- k-medoids, which selects actual data points as cluster centers
- Fuzzy c-means, which allows soft cluster memberships
- OPTICS, which uses reachability distances for ordering
Correct answer: k-modes, which uses mode instead of mean and Hamming-based dissimilarity
k-modes replaces the mean with the mode for categorical variables and uses a dissimilarity measure like simple matching, making it suitable for categorical data.
Question 2: In matrix factorization for collaborative filtering, what do the latent factors typically represent?
- Latent features capturing abstract user preferences and item attributes that explain observed ratings (Correct answer)
- Explicit user demographic features extracted from profile data
- Cluster centroids computed from user-item interaction vectors
- Eigenvectors of the co-occurrence matrix scaled by singular values
Correct answer: Latent features capturing abstract user preferences and item attributes that explain observed ratings
Latent factors are learned abstract representations (e.g., genre preference, quality sensitivity) that explain the pattern of observed ratings without explicit feature engineering.
Question 3: What is the 'elbow method' limitation when used to select k for k-means clustering?
- The elbow is often ambiguous or absent, making objective k selection difficult in practice (Correct answer)
- It requires rerunning k-means for every possible value of k from 1 to n
- It only works when clusters have equal variance and size
- It maximizes the silhouette score rather than minimizing inertia
Correct answer: The elbow is often ambiguous or absent, making objective k selection difficult in practice
Real-world inertia curves often decrease smoothly without a clear inflection point, making the elbow subjective and unreliable for automated k selection.
Question 4: Isolation Forest detects anomalies by:
- Measuring how few random splits are needed to isolate a point in a random tree ensemble (Correct answer)
- Comparing each point's density to the average density of its k nearest neighbors
- Projecting data onto principal components and flagging high reconstruction errors
- Assigning outlier scores based on distance from the nearest cluster centroid
Correct answer: Measuring how few random splits are needed to isolate a point in a random tree ensemble
Anomalies are isolated quickly (few splits) because they are sparse and distinct, while normal points require many splits to isolate in randomly partitioned trees.
Question 5: In the context of autoencoders used for anomaly detection, a high reconstruction error for a test sample indicates:
- The sample differs significantly from the distribution the autoencoder was trained on, suggesting an anomaly (Correct answer)
- The latent bottleneck dimension is too small to encode the sample
- The autoencoder has overfit to training data and cannot generalize
- The sample belongs to the most common cluster in the training set
Correct answer: The sample differs significantly from the distribution the autoencoder was trained on, suggesting an anomaly
Autoencoders trained on normal data learn to reconstruct normal patterns well; anomalous inputs lie off-manifold and result in high reconstruction error.
Question 6: Which statement correctly describes the difference between density-based and centroid-based clustering?
- Density-based methods (e.g., DBSCAN) can find arbitrarily shaped clusters and handle noise, while centroid-based (e.g., k-means) assumes convex, roughly equal-sized clusters (Correct answer)
- Centroid-based methods require no hyperparameters while density-based methods require k to be specified
- Density-based methods always produce a hierarchical output while centroid-based produces a flat partition
- Centroid-based methods use graph-based connectivity while density-based methods use Euclidean distance exclusively
Correct answer: Density-based methods (e.g., DBSCAN) can find arbitrarily shaped clusters and handle noise, while centroid-based (e.g., k-means) assumes convex, roughly equal-sized clusters
DBSCAN and similar methods group dense regions regardless of shape and label sparse points as noise, whereas k-means partitions all points into k convex Voronoi regions.
Question 7: What is the primary purpose of whitening as a preprocessing step before applying ICA?
- To decorrelate the data and normalize variances so ICA only needs to find rotations maximizing non-Gaussianity (Correct answer)
- To remove outliers that violate the assumption of Gaussian source distributions
- To reduce the number of features to match the assumed number of independent sources
- To normalize feature ranges to [0, 1] to ensure numerical stability in gradient descent
Correct answer: To decorrelate the data and normalize variances so ICA only needs to find rotations maximizing non-Gaussianity
Whitening (sphering) decorrelates observations and scales them to unit variance, reducing the ICA problem to finding an orthogonal rotation that maximizes statistical independence.
When applying k-means to categorical data, which variant is the appropriate alternative?