0
0
ML Pythonprogramming~20 mins

DBSCAN clustering in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DBSCAN Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding DBSCAN Core Concepts

Which statement best describes the role of the epsilon (eps) parameter in DBSCAN clustering?

AIt sets the minimum number of clusters to find in the data.
BIt defines the maximum distance between two points to be considered neighbors.
CIt controls the maximum number of iterations during clustering.
DIt specifies the initial number of centroids for clustering.
Attempts:
2 left
Predict Output
intermediate
2:00remaining
DBSCAN Cluster Labels Output

What is the output of the following code snippet?

ML Python
from sklearn.cluster import DBSCAN
import numpy as np

X = np.array([[1, 2], [2, 2], [2, 3], [8, 7], [8, 8], [25, 80]])
model = DBSCAN(eps=1.5, min_samples=2)
labels = model.fit_predict(X)
print(labels.tolist())
A[0, 0, 0, 1, 1, -1]
B[0, 0, 0, 1, 1, 1]
C[0, 0, 1, 1, 1, -1]
D[-1, -1, -1, 0, 0, 1]
Attempts:
2 left
Hyperparameter
advanced
1:30remaining
Effect of Changing min_samples in DBSCAN

What is the most likely effect of increasing the min_samples parameter in DBSCAN while keeping eps constant?

AThe eps parameter will automatically adjust to compensate.
BClusters will merge into fewer larger clusters.
CThe algorithm will run faster due to fewer clusters.
DMore points will be labeled as noise because clusters require more neighbors.
Attempts:
2 left
Metrics
advanced
1:30remaining
Evaluating DBSCAN Clustering Quality

Which metric is most appropriate to evaluate the quality of clusters produced by DBSCAN when true labels are unknown?

ACross-Entropy Loss
BAccuracy
CSilhouette Score
DMean Squared Error
Attempts:
2 left
🔧 Debug
expert
2:00remaining
Identifying the Cause of Unexpected DBSCAN Output

Given the code below, why does the DBSCAN model assign all points to noise (-1)?

ML Python
from sklearn.cluster import DBSCAN
import numpy as np

X = np.array([[1, 2], [2, 2], [2, 3], [8, 7], [8, 8], [25, 80]])
model = DBSCAN(eps=0.5, min_samples=2)
labels = model.fit_predict(X)
print(labels.tolist())
AThe eps value is too small, so no points have enough neighbors to form clusters.
BThe min_samples value is too low, causing all points to be noise.
CThe input data must be normalized before applying DBSCAN.
DDBSCAN requires at least 10 points to form clusters.
Attempts:
2 left