1What is the primary goal of unsupervised learning?
Role of unsupervised learning
Easy
A.To train an agent to make decisions through rewards and punishments.
B.To predict a target variable based on labeled input features.
C.To find hidden patterns and structures in unlabeled data.
D.To classify data into predefined categories.
Correct Answer: To find hidden patterns and structures in unlabeled data.
Explanation:
Unsupervised learning works with data that does not have predefined labels or target outcomes, aiming to discover underlying patterns, groupings, or structures on its own.
Incorrect! Try again.
2What is the key difference between supervised and unsupervised learning?
Differences between supervised and unsupervised learning
Easy
A.The presence of labeled output data.
B.The type of computer hardware required.
C.The complexity of the algorithms used.
D.The size of the dataset.
Correct Answer: The presence of labeled output data.
Explanation:
Supervised learning requires a dataset with labeled outputs (or target variables) for training, whereas unsupervised learning works with unlabeled data.
Incorrect! Try again.
3Which distance metric calculates the straight-line distance between two points in a Euclidean space?
Euclidean, Manhattan, Cosine distances
Easy
A.Minkowski distance with p=1
B.Cosine distance
C.Manhattan distance
D.Euclidean distance
Correct Answer: Euclidean distance
Explanation:
Euclidean distance is the length of the straight line connecting two points. For two points and , it is calculated as .
Incorrect! Try again.
4Manhattan distance is calculated as the:
Euclidean, Manhattan, Cosine distances
Easy
A.Square root of the sum of squared differences of the coordinates.
B.Shortest path between two points.
C.Angle between two vectors.
D.Sum of the absolute differences of the coordinates.
Correct Answer: Sum of the absolute differences of the coordinates.
Explanation:
Manhattan distance, also known as L1 norm or taxicab distance, measures distance by summing the absolute differences between the coordinates of two points, as if navigating a city grid.
Incorrect! Try again.
5What does a cosine similarity of 1 between two vectors indicate?
Euclidean, Manhattan, Cosine distances
Easy
A.The vectors are perpendicular to each other.
B.The vectors have the same orientation.
C.The vectors have the same magnitude.
D.The vectors point in opposite directions.
Correct Answer: The vectors have the same orientation.
Explanation:
Cosine similarity measures the cosine of the angle between two vectors. A value of 1 means the angle is 0 degrees, so the vectors point in the exact same direction, regardless of their magnitude.
Incorrect! Try again.
6What is the fundamental objective of clustering algorithms?
Clustering Algorithms
Easy
A.To group similar data points together while keeping dissimilar points in different groups.
B.To classify data points into predefined labels.
C.To predict a continuous value for new data points.
D.To reduce the number of features in a dataset.
Correct Answer: To group similar data points together while keeping dissimilar points in different groups.
Explanation:
Clustering is the task of partitioning a dataset into groups (clusters) such that points within a single cluster are highly similar, and points in different clusters are dissimilar.
Incorrect! Try again.
7In the K-Means algorithm, what does the 'K' represent?
K-Means Clustering
Easy
A.The number of clusters to be formed.
B.The number of features for each data point.
C.The number of data points in the dataset.
D.The number of iterations the algorithm will run.
Correct Answer: The number of clusters to be formed.
Explanation:
The 'K' in K-Means is a hyperparameter that specifies the desired number of clusters the algorithm should partition the data into.
Incorrect! Try again.
8How is the centroid of a cluster updated in each iteration of the K-Means algorithm?
K-Means Clustering
Easy
A.By choosing a random data point from the cluster.
B.By taking the median of all data points in the cluster.
C.By calculating the mean of all data points assigned to that cluster.
D.By selecting the data point closest to the old centroid.
Correct Answer: By calculating the mean of all data points assigned to that cluster.
Explanation:
The 'Means' in K-Means refers to this step: after assigning all points to the nearest centroid, each centroid is moved to the mean (average) position of all the points in its cluster.
Incorrect! Try again.
9What is the primary purpose of the Elbow method in the context of K-Means clustering?
Elbow method
Easy
A.To initialize the cluster centroids.
B.To measure the final accuracy of the clustering.
C.To determine the optimal number of clusters (K).
D.To select the distance metric for the algorithm.
Correct Answer: To determine the optimal number of clusters (K).
Explanation:
The Elbow method involves running K-Means for a range of K values and plotting the inertia (sum of squared distances). The 'elbow' point on the plot, where the rate of decrease sharply changes, suggests a good value for K.
Incorrect! Try again.
10How does a 'medoid' in the K-Medoids algorithm differ from a 'centroid' in K-Means?
K-Medoids
Easy
A.A medoid is an actual data point in the cluster, while a centroid is the mean of the points.
B.There is no difference; the terms are interchangeable.
C.A medoid is the mean of the points, while a centroid is an actual data point.
D.A medoid is used for categorical data, while a centroid is for numerical data.
Correct Answer: A medoid is an actual data point in the cluster, while a centroid is the mean of the points.
Explanation:
K-Medoids is a variation of K-Means where the center of each cluster (the medoid) is restricted to be one of the actual data points in the dataset. This makes it more robust to outliers than K-Means.
Incorrect! Try again.
11What is the typical visual output of a hierarchical clustering algorithm?
Hierarchical Clustering
Easy
A.A scatter plot
B.A line graph
C.A dendrogram
D.A confusion matrix
Correct Answer: A dendrogram
Explanation:
A dendrogram is a tree-like diagram that records the sequence of merges or splits, showing the hierarchical relationship between clusters.
Incorrect! Try again.
12Agglomerative hierarchical clustering follows which approach?
Hierarchical Clustering
Easy
A.A 'top-down' approach, starting with one big cluster and splitting it.
B.A 'bottom-up' approach, starting with individual points and merging them into clusters.
Correct Answer: A 'bottom-up' approach, starting with individual points and merging them into clusters.
Explanation:
Agglomerative clustering begins with each data point as its own cluster and iteratively merges the closest pair of clusters until only one cluster (containing all points) remains.
Incorrect! Try again.
13In hierarchical clustering, what does 'complete linkage' measure?
linkage criteria
Easy
A.The maximum distance between any two points in two different clusters.
B.The distance between the centroids of two clusters.
C.The average distance between all pairs of points in two different clusters.
D.The minimum distance between any two points in two different clusters.
Correct Answer: The maximum distance between any two points in two different clusters.
Explanation:
Complete linkage, also known as the farthest-neighbor method, defines the distance between two clusters as the longest possible distance between any two points belonging to those two clusters.
Incorrect! Try again.
14What is a key advantage of density-based clustering algorithms like DBSCAN?
Density-Based Clustering
Easy
A.They can discover clusters of arbitrary shapes.
B.They always require the number of clusters to be specified beforehand.
C.They work best on datasets with very few points.
D.They are the fastest type of clustering algorithm.
Correct Answer: They can discover clusters of arbitrary shapes.
Explanation:
Unlike K-Means, which assumes clusters are spherical, density-based algorithms like DBSCAN can identify clusters of non-linear and arbitrary shapes by connecting points in high-density regions.
Incorrect! Try again.
15What is the primary objective of anomaly detection?
Anomaly Detection
Easy
A.To group all data points into a predefined number of clusters.
B.To predict a future value based on historical data.
C.To summarize the main features of a dataset.
D.To identify data points that deviate significantly from the rest of the data.
Correct Answer: To identify data points that deviate significantly from the rest of the data.
Explanation:
Anomaly detection (or outlier detection) is the process of finding rare items, events, or observations which raise suspicions by differing significantly from the majority of the data.
Incorrect! Try again.
16In the context of K-Means, what does Inertia measure?
Evaluating clustering algorithms using Inertia
Easy
A.The number of misclassified points.
B.The total number of clusters.
C.The sum of squared distances of samples to their closest cluster center.
D.The ratio of between-cluster to within-cluster variance.
Correct Answer: The sum of squared distances of samples to their closest cluster center.
Explanation:
Inertia, also known as within-cluster sum-of-squares (WCSS), measures how internally coherent the clusters are. A lower inertia value indicates that the clusters are more dense and compact.
Incorrect! Try again.
17What does a Silhouette Score close to +1 for a data point indicate?
Silhouette Score
Easy
A.The point is an outlier.
B.The point is well-matched to its own cluster and poorly matched to neighboring clusters.
C.The point may have been assigned to the wrong cluster.
D.The point is on the border between two clusters.
Correct Answer: The point is well-matched to its own cluster and poorly matched to neighboring clusters.
Explanation:
A high Silhouette Score (near +1) signifies that the point is far from neighboring clusters and close to other points in its own cluster, indicating a good clustering assignment for that point.
Incorrect! Try again.
18A Silhouette Score close to 0 for a data point suggests that:
Silhouette Score
Easy
A.The point is an outlier that doesn't belong to any cluster.
B.The point is in a very dense and well-separated cluster.
C.The point is very close to the boundary between two clusters.
D.The clustering is perfect.
Correct Answer: The point is very close to the boundary between two clusters.
Explanation:
A Silhouette Score around 0 indicates that the point is on or very close to the decision boundary, meaning its distance to its own cluster and the neighboring cluster is very similar.
Incorrect! Try again.
19When evaluating clustering performance with the Davies–Bouldin Index (DBI), what kind of value is desirable?
Davies–Bouldin Index
Easy
A.A high value.
B.A low value.
C.A negative value.
D.A value close to zero.
Correct Answer: A low value.
Explanation:
The Davies–Bouldin Index measures the average similarity ratio of each cluster with its most similar cluster. Lower values indicate better clustering, where clusters are compact (low intra-cluster distance) and well-separated (high inter-cluster distance).
Incorrect! Try again.
20For which type of data is cosine similarity often a more effective distance metric than Euclidean distance?
Choosing appropriate distance metrics
Easy
A.Low-dimensional geographical data (e.g., GPS coordinates).
B.Image pixel intensity data.
C.Customer age and income data.
D.High-dimensional text data (e.g., document analysis).
Correct Answer: High-dimensional text data (e.g., document analysis).
Explanation:
In high-dimensional spaces like text analysis (where each word is a dimension), the magnitude of vectors (e.g., document length) can be misleading. Cosine similarity focuses on the orientation (i.e., the relative frequency of words), which is often more relevant for determining topic similarity.
Incorrect! Try again.
21A financial services company wants to segment its customer base into distinct groups based on their transaction history and demographic data. The company does not have any predefined labels for these groups. The goal is to discover these segments to create targeted marketing campaigns. Which machine learning paradigm is most appropriate for this task and why?
Differences between supervised and unsupervised learning
Medium
A.Semi-supervised learning, because some customers are already categorized.
B.Supervised learning, because the goal is to predict a specific outcome.
C.Reinforcement learning, because the system needs to learn from rewards and penalties.
D.Unsupervised learning, because the goal is to find inherent patterns and structures in unlabeled data.
Correct Answer: Unsupervised learning, because the goal is to find inherent patterns and structures in unlabeled data.
Explanation:
Unsupervised learning is used when there are no explicit labels in the data. The objective is to infer the natural structure present within a dataset. Customer segmentation is a classic example of clustering, a type of unsupervised learning, where the algorithm groups similar customers together without any prior knowledge of the group definitions.
Incorrect! Try again.
22Consider two data points in a 2D space: P1 = (2, 5) and P2 = (6, 2). Calculate the Euclidean distance () and Manhattan distance () between them.
Euclidean, Manhattan, Cosine distances
Medium
A.,
B.,
C.,
D.,
Correct Answer: ,
Explanation:
The Euclidean distance is calculated as . The Manhattan distance is calculated as .
Incorrect! Try again.
23In the K-Means algorithm, after assigning all data points to the nearest centroid, what is the immediate next step in an iteration?
K-Means Clustering
Medium
A.Recalculate the position of each centroid to be the mean of all points assigned to it.
B.Calculate the total inertia and stop if it has converged.
C.Re-assign each data point to the new closest centroid.
D.Select a new set of random centroids to start the next iteration.
Correct Answer: Recalculate the position of each centroid to be the mean of all points assigned to it.
Explanation:
The K-Means algorithm is an iterative two-step process. The first step is the 'assignment step,' where each data point is assigned to its nearest centroid. The second step is the 'update step,' where the centroid of each cluster is moved to the mean (center) of all the data points that have been assigned to it. This cycle repeats until convergence.
Incorrect! Try again.
24You have generated an elbow plot to find the optimal number of clusters for K-Means. The plot shows the Sum of Squared Errors (Inertia) for K values from 1 to 10. The inertia drops sharply from K=1 to K=3, then shows a much smaller, almost linear decrease for K > 3. What is the most appropriate choice for K?
Elbow method
Medium
A.K = 10, because it has the lowest possible inertia among the options.
B.K = 5, as a compromise between model complexity and inertia.
C.K = 1, because it is the simplest model.
D.K = 3, because it's the 'elbow point' where adding more clusters yields diminishing returns.
Correct Answer: K = 3, because it's the 'elbow point' where adding more clusters yields diminishing returns.
Explanation:
The Elbow method aims to find the point where the rate of decrease in inertia slows down significantly, forming an 'elbow' shape in the plot. This point represents a trade-off where increasing the number of clusters (K) beyond this point does not significantly explain more of the variance in the data. Choosing K=10 would lead to overfitting, as inertia will always decrease as K increases.
Incorrect! Try again.
25What is the primary advantage of the K-Medoids (PAM) algorithm over K-Means, especially in datasets with outliers?
K-Medoids
Medium
A.K-Medoids does not require the number of clusters (K) to be specified beforehand.
B.K-Medoids is computationally faster than K-Means for large datasets.
C.K-Medoids can find non-spherical clusters, unlike K-Means.
D.K-Medoids is more robust to outliers because its centroids (medoids) must be actual data points.
Correct Answer: K-Medoids is more robust to outliers because its centroids (medoids) must be actual data points.
Explanation:
In K-Means, the centroid is the mean of the points in a cluster, which can be heavily skewed by outliers. In K-Medoids, the representative point (medoid) is restricted to be one of the actual data points in the cluster. This constraint makes the medoid less sensitive to the influence of extreme outlier values, resulting in more robust clusters.
Incorrect! Try again.
26After performing agglomerative hierarchical clustering, you are examining the resulting dendrogram. If you draw a horizontal line that intersects three vertical lines of the dendrogram, what does this signify?
Hierarchical Clustering
Medium
A.It indicates that the optimal number of clusters for the dataset is exactly 3.
B.It shows that the algorithm ran for 3 iterations before stopping.
C.It suggests that the data can be meaningfully partitioned into 3 clusters at that level of dissimilarity.
D.It means that there are 3 outliers in the dataset.
Correct Answer: It suggests that the data can be meaningfully partitioned into 3 clusters at that level of dissimilarity.
Explanation:
A dendrogram visually represents the process of hierarchical clustering. The vertical lines represent data points or clusters. By cutting the dendrogram with a horizontal line, you are setting a dissimilarity threshold. The number of vertical lines the horizontal line crosses determines the number of clusters formed at that threshold. It provides a way to partition the data into a specific number of clusters, but doesn't necessarily mean that number is optimal.
Incorrect! Try again.
27In agglomerative hierarchical clustering, which linkage criterion tends to produce long, chain-like clusters and is sensitive to noise between clusters?
linkage criteria
Medium
A.Average linkage
B.Single linkage
C.Ward's linkage
D.Complete linkage
Correct Answer: Single linkage
Explanation:
Single linkage measures the distance between the two closest points of two clusters. This can lead to a 'chaining effect' where clusters are merged if even a single pair of points is close, regardless of the overall cluster shapes. This makes it sensitive to noise and often results in elongated, non-compact clusters.
Incorrect! Try again.
28You are using the DBSCAN algorithm with parameters eps = 1.0 and MinPts = 4. A data point P has exactly 3 other data points within its eps-radius. How will DBSCAN classify point P?
Density-Based Clustering
Medium
A.As a border point.
B.As a core point.
C.This scenario is impossible in DBSCAN.
D.As a noise point.
Correct Answer: As a noise point.
Explanation:
In DBSCAN, a point is a 'core point' if it has at least MinPts neighbors (including itself) within the eps-radius. Point A has 3 neighbors, so it only has 4 points in its neighborhood, which is less than MinPts=5. Therefore, it is not a core point. A 'border point' is not a core point but lies within the eps-radius of a core point. Since the question states it's not in the radius of any core point, it cannot be a border point. Any point that is neither a core nor a border point is classified as a 'noise point'.
Incorrect! Try again.
29A clustering result yields an average Silhouette Score of -0.2. What is the most accurate interpretation of this score?
Silhouette Score
Medium
A.The number of clusters chosen is likely the optimal number.
B.The clustering is excellent, with well-defined and dense clusters.
C.The clusters are too sparse to be evaluated correctly.
D.The clustering is poor, and many data points may have been assigned to the wrong clusters.
Correct Answer: The clustering is poor, and many data points may have been assigned to the wrong clusters.
Explanation:
The Silhouette Score ranges from -1 to 1. A score close to +1 indicates that the object is well matched to its own cluster and poorly matched to neighboring clusters. A score close to 0 indicates that the object is on or very close to the decision boundary between two neighboring clusters. A negative score (close to -1) indicates that the object has likely been assigned to the wrong cluster, as it is closer to the points in a neighboring cluster than to the points in its own cluster. An average score of -0.2 suggests a poor clustering configuration.
Incorrect! Try again.
30You are comparing clustering performance for different values of K. For K=3, the Davies-Bouldin Index (DBI) is 0.75. For K=4, the DBI is 1.2. Based solely on this metric, which result is better and why?
Davies–Bouldin Index
Medium
A.Both are equally good as the DBI is only for comparing different algorithms, not different K values.
B.Neither is good, as a DBI score must be less than 0 for a valid clustering.
C.K=3 is better because a lower Davies-Bouldin Index indicates better-defined, more separated clusters.
D.K=4 is better because a higher Davies-Bouldin Index indicates higher inter-cluster variance.
Correct Answer: K=3 is better because a lower Davies-Bouldin Index indicates better-defined, more separated clusters.
Explanation:
The Davies-Bouldin Index is an evaluation metric where a lower value signifies a better clustering. It is calculated as the average similarity measure of each cluster with its most similar cluster. 'Similarity' is the ratio of within-cluster distances to between-cluster distances. Therefore, a lower DBI score indicates that clusters are more compact (low within-cluster distance) and well-separated (high between-cluster distance). In this case, 0.75 is lower than 1.2, so K=3 provides a better clustering result according to DBI.
Incorrect! Try again.
31You are tasked with clustering a dataset of user profiles, where features are a mix of numerical (age, income) and categorical (city, profession). The numerical features are on vastly different scales. Which distance metric is most appropriate for this scenario?
Choosing appropriate distance metrics
Medium
A.Cosine Distance, because it focuses on the orientation of the feature vectors.
B.Manhattan Distance, because it is more robust to outliers than Euclidean distance.
C.Euclidean Distance, because it is the most common and works well for all data types.
D.Gower's Distance, because it can handle mixed data types by using different measures for each type.
Correct Answer: Gower's Distance, because it can handle mixed data types by using different measures for each type.
Explanation:
Standard distance metrics like Euclidean or Manhattan are designed for numerical data and perform poorly with mixed data types. Cosine distance is typically for high-dimensional text data. Gower's Distance is specifically designed for mixed data types. It computes a weighted sum of distances for each variable type: it uses range-normalized Manhattan distance for numerical features and Dice's coefficient or Jaccard index for categorical features, making it ideal for this kind of heterogeneous dataset.
Incorrect! Try again.
32Which of the following scenarios is a canonical example of unsupervised anomaly detection?
Anomaly Detection
Medium
A.Predicting the stock price of a company based on its historical performance.
B.Building a model to classify emails as 'spam' or 'not spam' based on a large dataset of emails already labeled by users.
C.Grouping a set of news articles into topics like 'sports', 'politics', and 'technology'.
D.Identifying unusual credit card transactions from a large volume of normal transactions without pre-existing fraud labels.
Correct Answer: Identifying unusual credit card transactions from a large volume of normal transactions without pre-existing fraud labels.
Explanation:
Unsupervised anomaly detection is about finding data points that deviate significantly from the majority of the data, assuming no prior labels for what constitutes an 'anomaly'. Credit card fraud detection fits this perfectly, as the goal is to flag rare, suspicious activities that don't conform to normal spending patterns. Spam classification is supervised learning, stock price prediction is a regression problem (supervised), and grouping articles is a clustering task.
Incorrect! Try again.
33Why is Inertia (Within-Cluster Sum of Squares) often considered an insufficient metric on its own for evaluating the quality of a clustering result?
Evaluating clustering algorithms using Inertia
Medium
A.Because a lower inertia always corresponds to a better real-world clustering performance.
B.Because inertia assumes that clusters are non-spherical and of varying sizes.
C.Because inertia will always decrease as the number of clusters (K) increases, making it biased towards larger K values.
D.Because inertia cannot be calculated for clusters found by density-based algorithms like DBSCAN.
Correct Answer: Because inertia will always decrease as the number of clusters (K) increases, making it biased towards larger K values.
Explanation:
Inertia measures how internally coherent clusters are (i.e., how close points are to their centroid). However, it is a decreasing function of the number of clusters, K. In the extreme case where K equals the number of data points, inertia will be 0. This makes it impossible to use inertia alone to choose K, as it will always favor the highest value of K. Metrics like the Silhouette Score or Davies-Bouldin Index are needed because they balance intra-cluster cohesion with inter-cluster separation.
Incorrect! Try again.
34Two documents are represented by word frequency vectors V1 = [10, 20, 5] and V2 = [2, 4, 1]. How would the Cosine Distance between these two vectors be calculated, and what does its value imply?
Cosine distances
Medium
A.The distance will be 0, because V1 is a scalar multiple of V2, meaning they point in the exact same direction.
B.The distance cannot be calculated because the vectors are not normalized.
C.The distance depends on the Euclidean separation between the vectors, not their angle.
D.The distance will be large, because the magnitudes of the vectors are very different.
Correct Answer: The distance will be 0, because V1 is a scalar multiple of V2, meaning they point in the exact same direction.
Explanation:
Vector V1 is exactly 5 times vector V2 (5 * [2, 4, 1] = [10, 20, 5]). Cosine similarity measures the cosine of the angle between two vectors. Since V1 and V2 are scalar multiples, they are collinear and point in the same direction, so the angle between them is 0 degrees. The cosine of 0 is 1. Cosine Distance is calculated as 1 - Cosine Similarity. Therefore, the distance is 1 - 1 = 0. This demonstrates that cosine distance is insensitive to vector magnitude and only considers orientation, which is useful in applications like text analysis where document length can vary.
Incorrect! Try again.
35A data scientist is working on a high-dimensional dataset with 100 features. To improve the performance and interpretability of a subsequent supervised classification model, they first apply Principal Component Analysis (PCA) to reduce the feature space to 10 principal components. This initial step is an application of:
Role of unsupervised learning
Medium
A.Unsupervised learning for dimensionality reduction.
B.Semi-supervised learning for label propagation.
C.Reinforcement learning for policy optimization.
D.Supervised learning for feature selection.
Correct Answer: Unsupervised learning for dimensionality reduction.
Explanation:
Principal Component Analysis (PCA) is an unsupervised learning technique. It transforms the data into a new coordinate system of principal components without using any labels. Its primary use is for dimensionality reduction, where it identifies the directions (components) that capture the most variance in the data, allowing the original feature space to be represented by a smaller number of components. This is a common preprocessing step before applying supervised algorithms.
Incorrect! Try again.
36A key advantage of DBSCAN over K-Means is its ability to find arbitrarily shaped clusters and identify noise. What core assumption of K-Means does DBSCAN avoid, allowing it to have this flexibility?
Density-Based Clustering
Medium
A.The assumption that the number of clusters, K, must be known in advance.
B.The assumption that clusters have a similar number of data points.
C.The assumption that every data point must belong to a cluster.
D.The assumption that clusters are convex and isotropic (spherical).
Correct Answer: The assumption that clusters are convex and isotropic (spherical).
Explanation:
K-Means partitions data by minimizing the sum of squared distances to a cluster's centroid. This objective function inherently assumes that clusters are spherical (isotropic) and convex. It struggles with elongated, non-convex, or irregularly shaped clusters. DBSCAN defines clusters as dense regions of points, allowing it to identify clusters of any shape as long as the density criterion is met. While DBSCAN also doesn't require K to be specified, its main advantage in finding arbitrary shapes comes from dropping the convexity/sphericity assumption.
Incorrect! Try again.
37When analyzing a silhouette plot for a K-Means result with K=4, you notice that one of the clusters has a significantly lower average silhouette score than the others, and many of its points have negative scores. What is the most likely interpretation?
Silhouette Score
Medium
A.The value of K=4 is the optimal number of clusters for this dataset.
B.This cluster is the most dense and well-separated cluster of the four.
C.This particular cluster is poorly defined, and its points might be closer to a neighboring cluster.
D.The points in this cluster are outliers that should be removed.
Correct Answer: This particular cluster is poorly defined, and its points might be closer to a neighboring cluster.
Explanation:
The silhouette plot visualizes the silhouette score for each sample, grouped by cluster. A low average score for a cluster, especially with many negative values, indicates that the cluster is not well-separated. Negative scores for individual points mean they are, on average, closer to the points in a different cluster than to the points in their own cluster. This suggests that the cluster may not be a natural grouping or that the overall K value may be incorrect.
Incorrect! Try again.
38The initialization of centroids in K-Means is known to be a critical step. If a poor initialization places two centroids very close to each other within a single, large natural cluster, what is a likely outcome of the algorithm's execution?
K-Means Clustering
Medium
A.The algorithm will automatically merge the two close centroids into one.
B.One of the two centroids will be classified as an outlier and ignored.
C.The algorithm will fail to converge and run indefinitely.
D.The single large cluster may be incorrectly split into two, leading to a suboptimal local minimum.
Correct Answer: The single large cluster may be incorrectly split into two, leading to a suboptimal local minimum.
Explanation:
K-Means is a hill-climbing algorithm that is sensitive to the initial placement of centroids. If the initial centroids are not well-placed, the algorithm can converge to a local minimum of the inertia function, which is not the globally optimal solution. Placing two centroids within one natural cluster will likely cause the algorithm to partition that cluster into two smaller, artificial clusters, as each centroid carves out its own Voronoi cell from the surrounding points.
Incorrect! Try again.
39You are comparing the results of hierarchical clustering on a dataset with two distinct, well-separated spherical clusters of similar size. Which two linkage criteria are most likely to produce very similar, high-quality results for this specific dataset?
Hierarchical Clustering
Medium
A.Single linkage and Complete linkage
B.Average linkage and Single linkage
C.Complete linkage and Ward's linkage
D.Ward's linkage and Single linkage
Correct Answer: Complete linkage and Ward's linkage
Explanation:
For datasets with well-separated, spherical (globular) clusters, both Complete linkage and Ward's linkage tend to perform well. Complete linkage is less susceptible to noise than single linkage and produces more compact clusters. Ward's linkage specifically aims to minimize the total within-cluster variance, which naturally favors finding spherical clusters. Single linkage would be a poor choice as it can create long chains. In this ideal scenario, the results from Complete and Ward's linkage would likely be very similar and effective.
Incorrect! Try again.
40A dataset consists of customer purchase histories, which is very high-dimensional and sparse (most customers have not bought most products). Which clustering algorithm and distance metric combination would be most suitable?
Clustering Algorithms
Medium
A.K-Means with Cosine Distance
B.K-Medoids with Manhattan Distance
C.Hierarchical Clustering with Ward's Linkage
D.DBSCAN with Euclidean Distance
Correct Answer: K-Means with Cosine Distance
Explanation:
High-dimensional and sparse data, such as text or purchase history, often suffers from the 'curse of dimensionality,' where Euclidean and Manhattan distances become less meaningful. Cosine distance is ideal for this type of data because it measures the orientation (angle) of the vectors rather than their magnitude. It effectively captures the similarity of purchase patterns regardless of the total number of items purchased. K-Means (or its variant Spherical K-Means) is frequently used with cosine distance for such problems.
Incorrect! Try again.
41In a standard K-Means implementation, the objective is to minimize the within-cluster sum of squares (WCSS). Consider a scenario where you replace the standard centroid update step (calculating the mean of points in a cluster) with a step that finds the geometric median of the points. What is the primary implication of this change on the algorithm's objective and behavior?
K-Means Clustering
Hard
A.The algorithm would fail to converge because the geometric median does not guarantee a decrease in the WCSS objective function.
B.The algorithm would now implicitly minimize the sum of Euclidean distances (not squared) to the cluster center, making it more robust to outliers.
C.The algorithm would now implicitly minimize the sum of Manhattan distances to the cluster center, making it more robust to outliers.
D.The algorithm's performance would be identical to K-Medoids, as the geometric median is always one of the data points.
Correct Answer: The algorithm would now implicitly minimize the sum of Euclidean distances (not squared) to the cluster center, making it more robust to outliers.
Explanation:
The geometric mean minimizes the sum of squared Euclidean distances, which is the standard K-Means objective. The geometric median, however, is the point that minimizes the sum of Euclidean distances to all points in a set. This new objective function is less sensitive to the large errors caused by outliers (since the distances are not squared), making the resulting algorithm (known as K-medians clustering, not to be confused with K-Medoids) more robust. Option A is incorrect because this describes using Manhattan distance and component-wise medians. Option C is incorrect; while it's no longer minimizing WCSS, the algorithm would still converge to a local minimum of the new objective function. Option D is incorrect as the geometric median is not necessarily one of the data points, which is the defining characteristic of a medoid.
Incorrect! Try again.
42You are performing agglomerative hierarchical clustering on a dataset with 1,000,000 points. Your primary constraint is computational efficiency, specifically memory usage for storing the distance matrix. Which linkage method, when implemented naively, is most problematic, and which of the following provides the best alternative strategy?
Hierarchical Clustering
Hard
A.Complete linkage is most problematic because it requires scanning all pairs of points between clusters. A better strategy is to use a density-based method like DBSCAN instead.
B.Ward's linkage is most problematic because its objective function is complex. A better strategy is to use a divisive hierarchical algorithm like DIANA.
C.Single linkage is most problematic due to its chaining tendency. A better strategy is to use Ward's linkage which creates more balanced clusters.
D.All linkage methods are equally problematic due to the space complexity. The best strategy is to first apply K-Means to create 10,000 micro-clusters and then perform hierarchical clustering on their centroids.
Correct Answer: All linkage methods are equally problematic due to the space complexity. The best strategy is to first apply K-Means to create 10,000 micro-clusters and then perform hierarchical clustering on their centroids.
Explanation:
A naive implementation of agglomerative clustering requires computing and storing a proximity matrix of size , which for would require an unfeasibly large amount of memory ( space). All standard linkage methods (single, complete, average, Ward's) face this bottleneck. The most effective and common strategy for large datasets is a hybrid approach, like the one described. First, partition the data into a larger number of small clusters (micro-clusters) using a scalable algorithm like K-Means or BIRCH. Then, perform the more computationally expensive hierarchical clustering on the centroids of these micro-clusters. This drastically reduces for the hierarchical step, making the problem tractable.
Incorrect! Try again.
43Consider using DBSCAN on a dataset containing clusters of significantly different densities. For instance, Cluster A is very dense, and Cluster B is much sparser. If you choose the eps and min_samples parameters to correctly identify Cluster A, what is the most likely outcome for Cluster B?
Density-Based Clustering
Hard
A.The points in Cluster B will form their own, correct cluster, as DBSCAN is robust to density variations.
B.The points in Cluster B will be fragmented into multiple, smaller clusters.
C.The points in Cluster B will likely be classified as noise points.
D.The points in Cluster B will be merged with Cluster A into a single large cluster.
Correct Answer: The points in Cluster B will likely be classified as noise points.
Explanation:
DBSCAN uses a single, global set of parameters (eps and min_samples) to define density. To identify the very dense Cluster A, you would need a small eps and/or a high min_samples. When these parameters are applied to the much sparser Cluster B, it's highly probable that none of its points will qualify as core points (i.e., they won't have min_samples neighbors within the small eps radius). As a result, the points in Cluster B, which do not meet the high-density criteria set for Cluster A, will be classified as noise. This highlights a key limitation of DBSCAN, which is addressed by algorithms like OPTICS.
Incorrect! Try again.
44A clustering algorithm produces two clusters on a dataset. The resulting average Silhouette Score is -0.1. What is the most precise and accurate interpretation of this result?
Silhouette Score
Hard
A.The number of clusters chosen is incorrect, and increasing the number of clusters will certainly improve the score.
B.On average, points are closer to the centroid of a neighboring cluster than to their own cluster's centroid.
C.The clustering is completely incorrect, and a random assignment of points would be better.
D.The majority of points have likely been assigned to the wrong cluster, suggesting the clusters are overlapping significantly.
Correct Answer: The majority of points have likely been assigned to the wrong cluster, suggesting the clusters are overlapping significantly.
Explanation:
The Silhouette Score for a single point, , ranges from -1 to 1. A score near 0 indicates overlapping clusters. A negative score means that , where is the mean intra-cluster distance and is the mean nearest-cluster distance. A negative score for a point implies it is, on average, closer to the points in a neighboring cluster than to the points in its own cluster. An average score of -0.1 means that this is true for a significant portion of the dataset, indicating a very poor clustering where many points are misassigned, likely due to heavy overlap or an incorrect cluster structure being imposed on the data.
Incorrect! Try again.
45You are working with a dataset of user movie ratings on a scale of 1-5, where many users have rated only a small fraction of the available movies (i.e., the data is sparse). You want to cluster users based on their taste. Why is Euclidean distance a poor choice of metric compared to Cosine similarity in this specific context?
Choosing appropriate distance metrics
Hard
A.Euclidean distance cannot handle the high dimensionality of the data, while Cosine similarity is specifically designed for high dimensions.
B.Euclidean distance treats the absence of a rating (a zero in the vector) as a low rating (e.g., a rating of 0), which incorrectly penalizes users who have rated different sets of movies.
C.Euclidean distance is computationally more expensive than Cosine similarity for sparse vectors.
D.Euclidean distance is not a valid metric for integer-valued data, whereas Cosine similarity is.
Correct Answer: Euclidean distance treats the absence of a rating (a zero in the vector) as a low rating (e.g., a rating of 0), which incorrectly penalizes users who have rated different sets of movies.
Explanation:
This is a classic problem in collaborative filtering. In a user-movie matrix, a missing rating is usually represented as a 0. For two users who have rated completely different sets of movies, their vectors will be orthogonal but far apart in Euclidean space. For example, User A = [5, 5, 0, 0] and User B = [0, 0, 5, 5]. Euclidean distance between them will be large, suggesting they are dissimilar. However, they haven't expressed disagreement; they've just rated different things. Cosine similarity measures the angle between vectors, ignoring magnitude. It correctly identifies that we don't have enough information to judge their similarity or dissimilarity based on these ratings. Crucially, Euclidean distance treats the shared zeros (unrated movies) as a point of agreement on a low rating, which is semantically incorrect and biases the similarity measure.
Incorrect! Try again.
46You are comparing two clustering results, A and B, on the same dataset. Result A has a Davies-Bouldin Index (DBI) of 0.8. Result B has a DBI of 1.5. However, visually inspecting the clusters, result B appears to have more distinct and well-separated clusters than A. Which characteristic of the dataset and clustering B is the most likely cause for this counter-intuitive DBI result?
Davies–Bouldin Index
Hard
A.Result B has a much larger number of clusters than Result A, and DBI always penalizes a higher number of clusters.
B.The calculation for result A must be erroneous, as a DBI of 0.8 indicates near-perfect clustering which contradicts the visual inspection.
C.Result B has clusters that are non-convex (e.g., crescent-shaped), which DBI cannot evaluate correctly.
D.Result B has clusters of highly varying sizes and densities; a very large, sparse cluster paired with a small, dense cluster can lead to a high (poor) DBI score even if they are well-separated.
Correct Answer: Result B has clusters of highly varying sizes and densities; a very large, sparse cluster paired with a small, dense cluster can lead to a high (poor) DBI score even if they are well-separated.
Explanation:
The Davies-Bouldin Index for a cluster is calculated by finding , where ( = intra-cluster scatter, = inter-cluster distance). The final DBI is the average of these maximums over all clusters. If you have a large, sparse cluster (high ) and a small, dense cluster (low ), the term can be large. Even if the distance between their centroids () is also large, the ratio can be high, leading to a poor DBI score for the larger cluster. This sensitivity to variations in cluster density and size can make the DBI misleading in such scenarios, even when the clusters are visually distinct.
Incorrect! Try again.
47You apply K-Means clustering for a range of values from 2 to 20 on a dataset and plot the WCSS (Inertia) to use the Elbow method. The resulting plot shows a smooth, convex curve with no clear 'elbow'. Which of the following is the most plausible characteristic of the underlying data distribution?
Elbow method
Hard
A.The data contains exactly two, non-spherical clusters (e.g., two interlocking moons).
B.The data forms a single, large, globular (Gaussian-like) distribution with no distinct sub-clusters.
C.The data is uniformly distributed within a square or hypercube.
D.The data consists of several very dense, well-separated, spherical clusters.
Correct Answer: The data forms a single, large, globular (Gaussian-like) distribution with no distinct sub-clusters.
Explanation:
The Elbow method relies on the principle that adding another cluster will significantly reduce WCSS if it splits a natural cluster, but the reduction will be marginal if it splits a homogeneous group. If the data has no real underlying cluster structure and is just a single blob (like a Gaussian distribution), then each additional centroid added by increasing will simply find a new pocket of variance to explain. This results in a steady, gradual decrease in WCSS without any sharp drop or 'elbow' point. Uniform data might also produce a smooth curve. In contrast, well-separated clusters would create a very sharp elbow, and non-spherical clusters would still likely show some (less clear) elbow, but the underlying WCSS metric itself would be inappropriate.
Incorrect! Try again.
48K-Medoids (using Partitioning Around Medoids - PAM) is often preferred over K-Means in the presence of outliers. While its robustness is due to using an actual data point (medoid) as the cluster center, what is the primary trade-off associated with this choice, especially on large datasets?
K-Medoids
Hard
A.The computational complexity of the medoid update step in PAM is significantly higher than the centroid update step in K-Means.
B.K-Medoids is guaranteed to find the global optimum, whereas K-Means gets stuck in local minima.
C.K-Medoids cannot be used with arbitrary distance metrics, unlike K-Means.
D.K-Medoids is more sensitive to the initial choice of medoids than K-Means is to the initial choice of centroids.
Correct Answer: The computational complexity of the medoid update step in PAM is significantly higher than the centroid update step in K-Means.
Explanation:
In K-Means, updating the centroid is a simple operation (calculating the mean of the points in the cluster). In the swap step of the PAM algorithm, for each cluster, it iteratively considers swapping the current medoid with every other non-medoid point within that cluster to see if the total cost decreases. This makes the update step for a single iteration have a complexity of approximately , which is much higher than K-Means' . This computational burden is the primary trade-off for the increased robustness and flexibility of K-Medoids.
Incorrect! Try again.
49Two different K-Means clustering runs are performed on the same dataset with . Run A results in an Inertia of 500. Run B results in an Inertia of 700. Both runs use standardized data (zero mean, unit variance). Which conclusion can be drawn with the highest degree of certainty?
Inertia
Hard
A.Run B likely converged to a poor local minimum, and Run A is closer to the global minimum of the WCSS objective.
B.The clustering from Run A is guaranteed to be qualitatively better and more useful for the business problem.
C.The clusters in Run A are more spherical and equally sized than the clusters in Run B.
D.The data was not scaled correctly for Run B, leading to the higher Inertia.
Correct Answer: Run B likely converged to a poor local minimum, and Run A is closer to the global minimum of the WCSS objective.
Explanation:
Inertia (or WCSS) is the specific objective function that K-Means aims to minimize. A lower inertia for the same dataset and same means the algorithm found a solution that better minimizes this specific mathematical objective. Since K-Means with random initializations is prone to converging to local minima, the most direct and certain conclusion is that Run A found a better solution in terms of the WCSS objective than Run B. We cannot conclude that Run A is 'qualitatively better' (Option A) because minimizing WCSS is not always aligned with the desired real-world outcome, especially for non-spherical clusters. We also cannot conclude anything about the shape or size of the clusters (Option C), only the sum of squared distances. Option D is contradicted by the problem statement that data was standardized for both.
Incorrect! Try again.
50You are using a density-based clustering algorithm like DBSCAN for anomaly detection, where points classified as 'noise' are considered anomalies. In which of the following scenarios would this approach most likely fail, leading to a high number of false negatives (i.e., missing actual anomalies)?
Anomaly Detection
Hard
A.The normal data forms several distinct, dense, well-separated clusters.
B.The anomalies are context-dependent and are only anomalous relative to their local neighborhood.
C.A small, tight, but isolated cluster of anomalous events occurs.
D.The dataset has many global anomalies that are far from any dense region.
Correct Answer: A small, tight, but isolated cluster of anomalous events occurs.
Explanation:
DBSCAN identifies anomalies as points that are not part of any dense region (noise points). Its fundamental assumption for anomaly detection is that anomalies are isolated points. If a set of anomalous events are similar to each other, they might form their own small, dense cluster. If this new cluster has enough points (min_samples) within its eps radius, DBSCAN will identify it as a valid, normal cluster rather than flagging its members as anomalies. This would result in false negatives. This scenario is known as 'micro-cluster' anomaly, and it's a known weakness of using standard density-based clustering for anomaly detection.
Incorrect! Try again.
51Consider three 2D points: , , and . We want to find which point, A or B, is 'closer' to P. How does the choice of distance metric affect the outcome?
Euclidean, Manhattan, Cosine distances
Hard
A.A and B are equidistant from P under Euclidean distance.
B.A is closer to P under Manhattan distance, while B is closer under Euclidean distance.
C.B is closer to P under both Euclidean and Manhattan distances.
D.A is closer to P under Euclidean distance, while B is closer under Manhattan distance.
Correct Answer: A is closer to P under Euclidean distance, while B is closer under Manhattan distance.
Explanation:
This question highlights how different distance metrics perceive space.
Euclidean Distance (shortest direct path):
Under Euclidean distance, A is closer to P.
Manhattan Distance (city block distance):
Under Manhattan distance, B is closer to P.
This demonstrates that the notion of 'closeness' is dependent on the metric used, which is critical when choosing algorithms for grid-like or feature-independent spaces (favoring Manhattan) vs. continuous, feature-dependent spaces (favoring Euclidean).
Incorrect! Try again.
52In agglomerative hierarchical clustering, which linkage criterion is most sensitive to outliers and also has a tendency to produce long, chain-like clusters, and why?
linkage criteria
Hard
A.Average linkage, because outliers skew the average distance, pulling disparate clusters together into chains.
B.Single linkage, because the cluster distance is defined by the single closest pair of points, allowing outliers to act as a 'bridge' between distinct groups.
C.Ward's linkage, because it aims to minimize variance, and outliers dramatically increase variance, causing them to form their own chains.
D.Complete linkage, because it considers the furthest points, which are often outliers, thus forcing clusters to be compact.
Correct Answer: Single linkage, because the cluster distance is defined by the single closest pair of points, allowing outliers to act as a 'bridge' between distinct groups.
Explanation:
Single linkage defines the distance between two clusters as the minimum distance between any two points in the respective clusters. This property makes it highly susceptible to outliers. A single outlier located between two otherwise separate clusters can create a 'bridge,' causing the algorithm to merge them prematurely. This same property leads to the 'chaining' phenomenon, where the algorithm keeps adding points to the end of an existing cluster, creating long, non-compact shapes. Complete linkage is the opposite; it's sensitive to outliers but tends to produce compact, spherical clusters because it's based on the maximum distance.
Incorrect! Try again.
53A financial institution wants to build a system to detect fraudulent credit card transactions. They have a large dataset of transactions, but only a very small fraction (<<0.1%) have been reliably labeled as fraudulent by investigators. An analyst proposes using K-Means clustering on the entire dataset first and then treating any small, isolated clusters as potentially fraudulent. What is the primary conceptual challenge of this semi-supervised approach?
Differences between supervised and unsupervised learning
Hard
A.This is a pure supervised learning problem; clustering is entirely inappropriate and will yield no useful results.
B.K-Means is not designed for anomaly detection; a density-based algorithm like LOF would be the only valid unsupervised approach.
C.The approach is sound, but K-Means will be too slow for a large financial dataset.
D.The clustering algorithm's objective (minimizing variance) is not aligned with the goal of separating fraudulent from non-fraudulent transactions; normal but rare transaction patterns might be isolated as 'anomalies'.
Correct Answer: The clustering algorithm's objective (minimizing variance) is not aligned with the goal of separating fraudulent from non-fraudulent transactions; normal but rare transaction patterns might be isolated as 'anomalies'.
Explanation:
This question touches the boundary between unsupervised and supervised learning. The core issue is the mismatch of objectives. K-Means finds groups based on feature similarity (low variance). Fraudulent transactions are not necessarily 'similar' to each other in a way that forms a neat, low-variance cluster. Conversely, there might be many types of legitimate but rare transaction patterns (e.g., buying a rare collectible, a one-time international purchase) that would form small, isolated clusters. The K-Means algorithm, in its quest to minimize variance, might flag these legitimate rare events as anomalies and fail to group different types of fraud together. The fundamental assumption that 'fraud forms its own clusters' may not hold, and the algorithm's objective is not trained to find the specific patterns that define fraud.
Incorrect! Try again.
54An engineer is building a supervised classification model to predict customer churn. The dataset has over 500 features. To reduce dimensionality, they first apply K-Means clustering with k=20 to the feature set. They then replace the 500 features with a single new feature: the cluster ID (an integer from 0 to 19) for each customer. Why is this a fundamentally flawed feature engineering approach?
Role of unsupervised learning
Hard
A.The cluster IDs are categorical, but treating them as a single ordinal feature (0 < 1 < ... < 19) introduces an arbitrary and misleading ordering that the supervised model will interpret as a meaningful scale.
B.Using 20 clusters is too many; a smaller k like 5 would be more effective.
C.This approach is perfectly valid and is a standard technique called 'cluster-based feature engineering'.
D.K-Means is the wrong algorithm; Principal Component Analysis (PCA) should have been used for dimensionality reduction.
Correct Answer: The cluster IDs are categorical, but treating them as a single ordinal feature (0 < 1 < ... < 19) introduces an arbitrary and misleading ordering that the supervised model will interpret as a meaningful scale.
Explanation:
While using clustering for feature engineering can be powerful, this specific implementation is flawed. The K-Means algorithm assigns cluster labels (0, 1, 2,...) arbitrarily. There is no inherent meaning to the ordering; cluster 5 is not 'greater than' or 'more of something' than cluster 4. By encoding this as a single numerical feature, most supervised models (like linear regression, SVMs, or gradient boosting trees) will interpret this as an ordinal variable, assuming a monotonic relationship that does not exist. This misleads the model and damages its performance. The correct way to use these cluster assignments as features would be to one-hot encode them, creating 20 new binary features, which treats them as distinct categories without an artificial order.
Incorrect! Try again.
55You are given a dataset that contains two dense, crescent-shaped clusters that are interlocking. There is also a significant amount of uniform random noise scattered throughout the space. Which clustering algorithm and parameterization philosophy would be most effective at correctly identifying the two crescent shapes while ignoring the noise?
Clustering Algorithms
Hard
A.DBSCAN, with eps set to capture the density of the crescents and min_samples set high enough to ignore the sparser random noise.
B.Gaussian Mixture Model (GMM) with 2 components, as it can model the probability distribution of each cluster.
C.Agglomerative Hierarchical Clustering with Ward's linkage, as it minimizes variance and will separate the noise.
D.K-Means with k=2, as it is efficient and will find the two dominant centroids.
Correct Answer: DBSCAN, with eps set to capture the density of the crescents and min_samples set high enough to ignore the sparser random noise.
Explanation:
This scenario is a classic use-case for density-based clustering. K-Means and Ward's linkage both have strong assumptions that clusters are convex or spherical and will fail catastrophically on interlocking crescent shapes, likely splitting each crescent and grouping parts from both. GMMs also assume clusters are Gaussian (ellipsoidal), which is a poor fit for crescents. DBSCAN, however, defines clusters as areas of high density. It can trace the arbitrary shape of the crescents as long as their points are density-connected. By carefully tuning eps to the 'thickness' of the crescents and min_samples to be higher than the density of the surrounding noise, it can successfully identify the two clusters and explicitly classify the noisy points as a separate 'noise' category.
Incorrect! Try again.
56A K-Means clustering with is performed on a dataset, yielding an average Silhouette Score of 0.75. The same dataset is then clustered with , and the score drops to 0.60. However, the Inertia (WCSS) for the clustering is significantly lower than for . What is the most likely reason for this divergence between the two metrics?
Silhouette Score
Hard
A.The Silhouette Score is malfunctioning; a lower Inertia should always result in a better or equal score.
B.The fifth cluster introduced in the solution likely split a natural, well-formed cluster from the solution, increasing the number of points that are now close to a neighboring cluster.
C.This indicates that the true number of clusters is actually 3 or less.
D.The solution must have been a poor local minimum, giving an artificially high Silhouette Score.
Correct Answer: The fifth cluster introduced in the solution likely split a natural, well-formed cluster from the solution, increasing the number of points that are now close to a neighboring cluster.
Explanation:
Inertia will almost always decrease as increases, because adding more centroids allows the algorithm to reduce the total sum of squared distances. It is a measure of cluster compactness only. The Silhouette Score, however, measures both compactness () and separation (). By setting , the algorithm was forced to split one of the natural clusters from the solution. While this split reduced the overall Inertia (as points are now closer to their new centroids), it created two new, less-separated clusters. Points along the split boundary now have a high intra-cluster distance () and a low nearest-cluster distance (), leading to a poor Silhouette Score for those points and pulling the overall average down. This divergence is a classic sign of over-clustering.
Incorrect! Try again.
57How does the OPTICS algorithm fundamentally differ from its predecessor, DBSCAN, in addressing the challenge of clustering data with varying densities?
Density-Based Clustering
Hard
A.OPTICS does not produce a single flat clustering, but rather a 'reachability plot' that represents the density-based structure, from which clusterings for any eps can be extracted.
B.OPTICS does not require the eps parameter, only min_samples, making it easier to tune.
C.OPTICS is a partitioning algorithm, while DBSCAN is hierarchical, allowing OPTICS to handle varied densities.
D.OPTICS uses a different distance metric than DBSCAN, which is more robust to density changes.
Correct Answer: OPTICS does not produce a single flat clustering, but rather a 'reachability plot' that represents the density-based structure, from which clusterings for any eps can be extracted.
Explanation:
The key innovation of OPTICS (Ordering Points To Identify the Clustering Structure) is that it doesn't assign cluster membership directly for a single eps value. Instead, it produces an ordering of the data points and their 'reachability distance'. This ordering places points that are close in density together. The resulting reachability plot can be visualized as a terrain map with valleys representing dense clusters. By setting a threshold on this plot, one can extract clusters equivalent to what DBSCAN would find for a specific eps. More importantly, one can use techniques to find the valleys automatically, allowing it to identify clusters of different densities from a single run of the algorithm, which is something DBSCAN cannot do.
Incorrect! Try again.
58You are performing K-Means on a dataset with features on vastly different scales (e.g., 'age' in years and 'income' in dollars). You forget to apply feature scaling. How does this oversight specifically affect the Inertia calculation and the resulting cluster shapes?
Inertia
Hard
A.It has no effect, as K-Means is invariant to feature scaling.
B.The Inertia value will be artificially low, but the cluster shapes will be correct.
C.The Inertia calculation will be dominated by the feature with the largest scale (e.g., income), causing the algorithm to produce clusters that are primarily separated along that feature's axis, ignoring others.
D.It will cause the K-Means algorithm to fail to converge.
Correct Answer: The Inertia calculation will be dominated by the feature with the largest scale (e.g., income), causing the algorithm to produce clusters that are primarily separated along that feature's axis, ignoring others.
Explanation:
Inertia is the sum of squared Euclidean distances. Euclidean distance is sensitive to the scale of the features. A feature like income, with a range in the tens of thousands, will contribute much more to the squared distance calculation than a feature like age, with a range of less than 100. Consequently, the K-Means algorithm, in its effort to minimize this distance-based objective function, will prioritize minimizing the variance of the high-scale feature. The resulting centroids and cluster assignments will be almost entirely determined by the 'income' feature, and the clusters will appear as vertical or horizontal bands when plotted, effectively ignoring the information in the lower-scale features.
Incorrect! Try again.
59The Isolation Forest algorithm detects anomalies by assuming they are 'few and different'. How does its method of partitioning the data exploit this assumption, and why is this more efficient than distance-based methods for high-dimensional data?
Anomaly Detection
Hard
A.It calculates the pairwise distance between all points and identifies anomalies as those with the largest average distance to their k-nearest neighbors.
B.It models the data as a Gaussian mixture and flags points in low-probability regions as anomalies, which is efficient as it only requires a few components.
C.It creates a one-class SVM to learn a boundary around the normal data, and anomalies are points outside this boundary. This is efficient because it avoids modeling the anomalies themselves.
D.It builds an ensemble of decision trees where, at each node, a random feature and a random split point are chosen. Anomalies, being different, are expected to be isolated in a path with a shorter length from the root.
Correct Answer: It builds an ensemble of decision trees where, at each node, a random feature and a random split point are chosen. Anomalies, being different, are expected to be isolated in a path with a shorter length from the root.
Explanation:
Isolation Forest works by building random trees. The core idea is that an anomalous point is easier to 'isolate' from the rest of the data than a normal point. In a tree structure, isolating a point means creating a path from the root to a leaf that contains only that point. Because anomalies are 'different', a random split is more likely to separate an anomaly from the rest of the data early on, resulting in a much shorter path from the root to the leaf. Normal points, being embedded in dense regions, require many more splits to be isolated. The algorithm averages the path length over an ensemble of such random trees to get a robust anomaly score. This approach avoids computing distances, which become less meaningful and computationally expensive in high-dimensional spaces (the curse of dimensionality), making it very efficient.
Incorrect! Try again.
60A key component of the Davies-Bouldin Index (DBI) is the similarity measure between two clusters and , defined as , where is a measure of scatter within a cluster and is the distance between clusters. A lower DBI is better. Which of the following cluster configurations would result in the lowest (best) possible DBI value?
Davies–Bouldin Index
Hard
A.Clusters that are very compact (small ) and whose centroids are very far from each other (large ).
B.A single, massive cluster containing all the data points.
C.Each data point is its own cluster.
D.Clusters that are elongated and chain-like but are far from each other.
Correct Answer: Clusters that are very compact (small ) and whose centroids are very far from each other (large ).
Explanation:
The Davies-Bouldin Index aims to find a clustering where each cluster is as compact as possible and as far away from other clusters as possible. The score for each cluster is determined by its worst-case similarity to another cluster. To minimize the overall DBI, we need to minimize the terms for all clusters. The ratio is minimized when the numerator (the sum of intra-cluster scatters) is very small and the denominator (the inter-cluster distance) is very large. This corresponds directly to a configuration of tight, compact clusters whose centers are widely separated. The case where each point is its own cluster (Option B) results in but makes the definition of complex and is generally considered a degenerate case with a poor/undefined score.