Q. If a dataset has 200 points and you apply K-means clustering with K=4, how many points will be assigned to each cluster on average?
A.50
B.40
C.60
D.30
Solution
If K=4 and there are 200 points, on average, each cluster will have 200/4 = 50 points assigned to it.
Correct Answer: A — 50
Q. If the distance between two clusters in hierarchical clustering is defined as the maximum distance between points in the clusters, what linkage method is being used?
A.Single linkage
B.Complete linkage
C.Average linkage
D.Centroid linkage
Solution
The method that defines the distance between two clusters as the maximum distance between points in the clusters is called complete linkage.
Correct Answer: B — Complete linkage
Q. In a K-means clustering algorithm, if you have 5 clusters and 100 data points, how many centroids will be initialized?
A.5
B.100
C.50
D.10
Solution
In K-means clustering, the number of centroids initialized is equal to the number of clusters. Therefore, if there are 5 clusters, 5 centroids will be initialized.
Correct Answer: A — 5
Q. In hierarchical clustering, what does 'agglomerative' mean?
A.Clusters are formed by splitting larger clusters
B.Clusters are formed by merging smaller clusters
C.Clusters are formed randomly
D.Clusters are formed based on a predefined distance
Solution
Agglomerative hierarchical clustering starts with each data point as its own cluster and merges them into larger clusters based on similarity.
Correct Answer: B — Clusters are formed by merging smaller clusters
Q. In hierarchical clustering, what does 'agglomerative' refer to?
A.A method that starts with all points as individual clusters
B.A method that requires the number of clusters to be predefined
C.A technique that merges clusters based on distance
D.A type of clustering that uses a centroid
Solution
Agglomerative clustering begins with each data point as its own cluster and merges them iteratively based on distance until a single cluster is formed.
Correct Answer: A — A method that starts with all points as individual clusters
Q. In hierarchical clustering, what does agglomerative clustering do?
A.Starts with all data points as individual clusters and merges them
B.Starts with one cluster and splits it into smaller clusters
C.Randomly assigns data points to clusters
D.Uses a predefined number of clusters
Solution
Agglomerative clustering begins with each data point as its own cluster and progressively merges them based on their similarities.
Correct Answer: A — Starts with all data points as individual clusters and merges them
Q. In hierarchical clustering, what does the term 'dendrogram' refer to?
A.A type of data point
B.A tree-like diagram that shows the arrangement of clusters
C.A method of calculating distances
D.A clustering algorithm
Solution
A dendrogram is a tree-like diagram that illustrates the arrangement of clusters formed during hierarchical clustering.
Correct Answer: B — A tree-like diagram that shows the arrangement of clusters
Q. In hierarchical clustering, what does the term 'linkage' refer to?
A.The method of assigning clusters to data points
B.The distance metric used to measure similarity
C.The strategy for merging clusters
D.The number of clusters to form
Solution
Linkage in hierarchical clustering refers to the strategy used to determine the distance between clusters, which affects how clusters are merged.
Correct Answer: C — The strategy for merging clusters
Q. In hierarchical clustering, what is agglomerative clustering?
A.A bottom-up approach to cluster formation
B.A top-down approach to cluster formation
C.A method that requires prior knowledge of clusters
D.A technique that uses K-means as a base
Solution
Agglomerative clustering is a bottom-up approach where each data point starts as its own cluster and pairs of clusters are merged as one moves up the hierarchy.
Correct Answer: A — A bottom-up approach to cluster formation
Q. In hierarchical clustering, what is the difference between agglomerative and divisive methods?
A.Agglomerative starts with individual points, divisive starts with one cluster
Agglomerative clustering starts with individual points and merges them into clusters, while divisive clustering starts with one cluster and splits it into smaller clusters.
Correct Answer: C — Both A and B
Q. In hierarchical clustering, what is the result of a dendrogram?
A.A visual representation of the clustering process
B.A table of cluster centroids
C.A list of data points in each cluster
D.A summary of the clustering algorithm's performance
Solution
A dendrogram visually represents the arrangement of clusters and the distances at which they are merged.
Correct Answer: A — A visual representation of the clustering process
Q. In hierarchical clustering, what is the result of the agglomerative approach?
A.Clusters are formed by splitting larger clusters
B.Clusters are formed by merging smaller clusters
C.Clusters are formed randomly
D.Clusters are formed based on a predefined number
Solution
The agglomerative approach in hierarchical clustering starts with individual data points and merges them into larger clusters based on similarity.
Correct Answer: B — Clusters are formed by merging smaller clusters
Q. In K-means clustering, what happens if K is set too high?
A.Clusters become too large
B.Overfitting occurs
C.Underfitting occurs
D.No effect
Solution
If K is set too high, the model may overfit the data, resulting in too many clusters that do not generalize well.
Correct Answer: B — Overfitting occurs
Q. In which scenario would hierarchical clustering be preferred over K-means?
A.When the number of clusters is known
B.When the dataset is very large
C.When a hierarchy of clusters is desired
D.When the data is strictly numerical
Solution
Hierarchical clustering is preferred when a hierarchy of clusters is desired, as it provides a tree-like structure of the data.
Correct Answer: C — When a hierarchy of clusters is desired
Q. In which scenario would you use reinforcement learning?
A.When you have labeled data for training
B.When the model needs to learn from interactions with an environment
C.When you want to cluster data points
D.When you need to predict a continuous outcome
Solution
Reinforcement learning is used when a model learns from interactions with an environment, optimizing actions based on rewards.
Correct Answer: B — When the model needs to learn from interactions with an environment
Q. What does the term 'feature engineering' refer to?
A.The process of selecting a model
B.The process of creating new input features from existing data
C.The process of tuning hyperparameters
D.The process of evaluating model performance
Solution
Feature engineering involves creating new input features from existing data to improve model performance.
Correct Answer: B — The process of creating new input features from existing data
Q. What is a common application of clustering in marketing?
A.Predicting customer behavior
B.Segmenting customers into distinct groups
C.Optimizing supply chain logistics
D.Forecasting sales trends
Solution
Clustering is often used in marketing to segment customers into distinct groups based on purchasing behavior or demographics.
Correct Answer: B — Segmenting customers into distinct groups
Q. What is a common application of clustering in real-world scenarios?
A.Spam detection in emails
B.Predicting stock prices
C.Image classification
D.Customer segmentation
Solution
Customer segmentation is a common application of clustering, where businesses group customers based on purchasing behavior or demographics.
Correct Answer: D — Customer segmentation
Q. What is a common application of K-means clustering in the real world?
A.Image segmentation
B.Spam detection
C.Sentiment analysis
D.Time series forecasting
Solution
K-means clustering is often used in image segmentation to group similar pixels together.
Correct Answer: A — Image segmentation
Q. What is a key advantage of using hierarchical clustering over K-means?
A.It requires less computational power
B.It does not require the number of clusters to be specified in advance
C.It is always more accurate
D.It can handle larger datasets
Solution
Hierarchical clustering does not require the number of clusters to be predetermined, allowing for more flexibility in exploring data.
Correct Answer: B — It does not require the number of clusters to be specified in advance
Q. What is a key characteristic of DBSCAN compared to K-means?
A.It requires the number of clusters to be specified
B.It can find clusters of arbitrary shape
C.It is faster than K-means for all datasets
D.It uses centroids to define clusters
Solution
DBSCAN can identify clusters of arbitrary shape and does not require the number of clusters to be specified in advance.
Correct Answer: B — It can find clusters of arbitrary shape
Q. What is overfitting in machine learning?
A.When a model performs well on training data but poorly on unseen data
B.When a model is too simple to capture the underlying trend
C.When a model is trained on too little data
D.When a model has too many features
Solution
Overfitting occurs when a model learns the training data too well, capturing noise and failing to generalize to new data.
Correct Answer: A — When a model performs well on training data but poorly on unseen data
Q. What is the effect of outliers on K-means clustering?
A.They have no effect on the clustering results
B.They can significantly distort the cluster centroids
C.They improve the clustering accuracy
D.They help in determining the number of clusters
Solution
Outliers can significantly distort the cluster centroids in K-means clustering, leading to inaccurate clustering results.
Correct Answer: B — They can significantly distort the cluster centroids
Q. What is the main advantage of hierarchical clustering over K-means?
A.It does not require the number of clusters to be specified in advance
B.It is faster and more efficient
C.It can handle larger datasets
D.It is less sensitive to outliers
Solution
Hierarchical clustering does not require the number of clusters to be predetermined, allowing for more flexibility in analysis.
Correct Answer: A — It does not require the number of clusters to be specified in advance
Q. What is the main advantage of using hierarchical clustering over K-means?
A.It is faster and more efficient
B.It does not require the number of clusters to be specified
C.It can handle large datasets better
D.It is less sensitive to outliers
Solution
Hierarchical clustering does not require the number of clusters to be specified in advance, allowing for more flexibility in cluster formation.
Correct Answer: B — It does not require the number of clusters to be specified
Q. What is the main criterion for determining the optimal number of clusters in K-means?
A.Silhouette score
B.Elbow method
C.Both A and B
D.None of the above
Solution
Both the Silhouette score and the Elbow method are commonly used criteria for determining the optimal number of clusters in K-means clustering.
Correct Answer: C — Both A and B
Q. What is the main difference between K-means and hierarchical clustering?
A.K-means is a partitional method, while hierarchical is a divisive method
B.K-means requires the number of clusters to be defined, while hierarchical does not
C.K-means can only be used for numerical data, while hierarchical can handle categorical data
D.K-means is faster than hierarchical clustering for small datasets
Solution
K-means is a partitional clustering method that divides data into a fixed number of clusters, while hierarchical clustering builds a tree of clusters without needing to specify the number of clusters in advance.
Correct Answer: B — K-means requires the number of clusters to be defined, while hierarchical does not
Q. What is the main difference between K-means and K-medoids clustering?
A.K-means uses centroids, while K-medoids uses actual data points
B.K-medoids is faster than K-means
C.K-means can only handle numerical data, while K-medoids can handle categorical data
D.K-medoids requires the number of clusters to be specified, while K-means does not
Solution
K-means uses centroids to represent clusters, while K-medoids uses actual data points as the center of clusters, making it more robust to outliers.
Correct Answer: A — K-means uses centroids, while K-medoids uses actual data points
Q. What is the main difference between supervised and unsupervised learning?
A.Supervised learning uses labeled data, unsupervised does not
B.Unsupervised learning is faster than supervised learning
C.Supervised learning is only for classification tasks
D.Unsupervised learning requires more data
Solution
The main difference is that supervised learning uses labeled data for training, while unsupervised learning works with unlabeled data.
Correct Answer: A — Supervised learning uses labeled data, unsupervised does not
Q. What is the main function of an activation function in a neural network?
A.To initialize weights
B.To introduce non-linearity into the model
C.To optimize the learning rate
D.To reduce the number of layers
Solution
Activation functions introduce non-linearity into neural networks, allowing them to learn complex patterns.
Correct Answer: B — To introduce non-linearity into the model