DSE - Data Science Unsupervised Learning: Clustering Questions and Answers — Questions and Answers
Question 1: A data scientist is working with a dataset containing customer transactions for an e-commerce platform. The goal is to segment customers into distinct groups based on their purchasing behavior to enable targeted marketing campaigns. The data contains non-globular cluster shapes and a significant amount of noise from fraudulent or one-time buyers. The number of customer segments is not known beforehand. Which clustering algorithm would be most appropriate for this scenario?
- K-Means
- Agglomerative Hierarchical Clustering
- DBSCAN (Correct answer)
- Gaussian Mixture Models
Correct answer: DBSCAN
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is the most suitable algorithm for this scenario. It excels at discovering clusters of arbitrary shapes, which is crucial for complex purchasing behaviors that don't form simple spherical groups. Importantly, DBSCAN can identify and label noise points (outliers), which is perfect for handling the fraudulent or one-time buyers. It also does not require the number of clusters to be specified in advance, a key advantage when the number of customer segments is unknown. K-Means assumes spherical clusters and is sensitive to outliers, making it a poor choice. Hierarchical clustering can be computationally expensive and the resulting dendrogram can be difficult to interpret for defining a clear number of clusters for marketing action. Gaussian Mixture Models assume the data conforms to a mixture of a finite number of Gaussian distributions, which may not hold true for complex purchasing patterns.
Question 2: Which of the following is a significant limitation of the K-Means clustering algorithm?
- It is computationally very expensive, with complexity that scales exponentially with the number of data points.
- It requires the user to manually specify the number of clusters, 'k', beforehand. (Correct answer)
- It can only be applied to datasets with a small number of features (low dimensionality).
- The resulting clusters are often difficult to interpret and visualize.
Correct answer: It requires the user to manually specify the number of clusters, 'k', beforehand.
A primary limitation of K-Means is that the number of clusters, 'k', is a hyperparameter that must be set by the user before running the algorithm. The quality of the clustering result is highly dependent on this choice. In contrast, K-Means is known for its computational efficiency, with a time complexity that scales linearly with the number of data points (O(n)), not exponentially. While it can be affected by the curse of dimensionality, it is not strictly limited to low-dimensional data. The resulting clusters, being centroid-based, are generally straightforward to interpret.
Question 3: In hierarchical clustering, what is the fundamental difference between the agglomerative and divisive approaches?
- Agglomerative is a top-down approach, while divisive is a bottom-up approach.
- Agglomerative starts with all data points in a single cluster and recursively splits them, while divisive starts with each point as its own cluster and merges them.
- Agglomerative is only suitable for numerical data, while divisive can handle categorical data.
- Agglomerative is a bottom-up approach that starts with each data point as an individual cluster and progressively merges them, while divisive is a top-down approach that starts with all points in one cluster and recursively splits them. (Correct answer)
Correct answer: Agglomerative is a bottom-up approach that starts with each data point as an individual cluster and progressively merges them, while divisive is a top-down approach that starts with all points in one cluster and recursively splits them.
Agglomerative clustering is a 'bottom-up' method. It begins with each data point in its own separate cluster and, in each step, merges the two closest clusters until only one cluster remains. Divisive clustering is the opposite, a 'top-down' method. It starts with all data points in a single, large cluster and recursively splits the most heterogeneous cluster into two until each data point is in its own cluster.
Question 4: A data scientist has just performed clustering on a dataset and wants to evaluate the quality of the resulting clusters without using any external labels. They choose to use the Davies-Bouldin Index. What would a low Davies-Bouldin Index score indicate?
- Poor clustering, with high similarity between clusters.
- Good clustering, with low intra-cluster similarity and high inter-cluster similarity.
- Good clustering, with clusters that are compact and well-separated from each other. (Correct answer)
- The algorithm failed to converge.
Correct answer: Good clustering, with clusters that are compact and well-separated from each other.
The Davies-Bouldin Index (DBI) evaluates clustering quality based on the ratio of within-cluster scatter to between-cluster separation. A lower DBI score indicates better clustering. This is because a low value signifies that the clusters are compact (low intra-cluster distance) and far apart from each other (high inter-cluster distance).
Question 5: What are the two primary parameters that need to be defined when using the DBSCAN algorithm?
- The number of clusters (k) and the linkage criteria.
- Epsilon (ε) and the minimum number of points (MinPts). (Correct answer)
- The initial centroid locations and the number of iterations.
- The distance metric and the desired dendrogram height.
Correct answer: Epsilon (ε) and the minimum number of points (MinPts).
DBSCAN's behavior is primarily controlled by two parameters: Epsilon (ε), which is the radius around a data point to be considered its neighborhood, and MinPts, the minimum number of data points required within that Epsilon radius (including the point itself) to classify it as a core point. These parameters together define the density required to form a cluster.
Question 6: Which of the following statements best describes unsupervised learning?
- A type of machine learning where the algorithm learns from data that has been manually labeled with the correct output.
- A type of machine learning focused on learning a mapping function from input variables to a continuous output variable.
- A type of machine learning where the algorithm learns to find patterns and inherent structures in unlabeled data. (Correct answer)
- A method of learning that involves an agent interacting with an environment to maximize a cumulative reward.
Correct answer: A type of machine learning where the algorithm learns to find patterns and inherent structures in unlabeled data.
Unsupervised learning is a branch of machine learning that deals with unlabeled data. Instead of predicting a known outcome, the goal of unsupervised algorithms is to explore the data to find hidden patterns, structures, or groupings, such as in clustering or dimensionality reduction. The other options describe supervised learning (labeled data), regression (a supervised task), and reinforcement learning (agent-based learning).
A data scientist is working with a dataset containing customer transactions for an e-commerce platform.
The goal is to segment customers into distinct groups based on their purchasing behavior to enable targeted marketing campaigns.
The data contains non-globular cluster shapes and a significant amount of noise from fraudulent or one-time buyers.
The number of customer segments is not known beforehand.
Which clustering algorithm would be most appropriate for this scenario?