1/67
Looks like no tags are added yet.
[Q1 - Part 1] Clustering vs Classification
Classification is supervised, assigning observations to predefined known class labels using a model trained on labeled data; clustering is unsupervised, discovering natural groupings in unlabeled data based solely on intrinsic feature similarity.
[Q1 - Part 1] Intra-Cluster Similarity Cohesion
A property of a useful clustering result where points within the same cluster are closely grouped together.
[Q1 - Part 1] Inter-Cluster Similarity Separation
A property of a useful clustering result where different clusters are well separated and distinct from one another.
[Q1 - Part 2] Davies-Bouldin Index Definition
An internal validation metric using dataset feature distances, measuring average worst-case ratio of within-cluster scatter to between-cluster separation; lower is better, used when ground-truth labels are unavailable.
[Q1 - Part 2] Adjusted Rand Index Definition
An external validation metric measuring agreement between predicted cluster assignments and true class labels, corrected for chance, up to 1.0; higher is better, used when ground-truth labels are available.
[Q1 - Part 2] Comparing Internal and External Validation
Internal validation metrics like DBI rely solely on intrinsic feature geometry without labels, while external validation metrics like ARI require ground-truth class labels to benchmark cluster quality.
[Q2 - Part 1] K-Means Main Operations
Assignment step: assign each point to the cluster with the closest centroid using Euclidean distance. Update step: recompute each centroid as the coordinate-wise mean of assigned points.
[Q2 - Part 1] K-Means Stopping Condition
The algorithm stops when cluster assignments no longer change between iterations, indicating that centroids have stabilized.
[Q2 - Part 2] Elbow Method Procedure
Compute the drop in SSE between consecutive K values, identify where large drops stop and reductions flatten into a bend, and justify the choice using those drops without stating the final K.
[Q2 - Part 2] Limitation of the Elbow Method
The elbow is subjective and often ambiguous when SSE decreases smoothly with no distinct bend, or when clusters are non-spherical or overlapping.
[Q2 - Part 3] Iteration 1 Assignment Procedure
Compute Euclidean distance from each point to each current centroid, assign to the nearer one, and apply the tie-rule where ties go to the centroid with the lower point number.
[Q2 - Part 3] Centroid Update Procedure
Average the x-values and the y-values of all points currently assigned to each cluster to determine updated centroid coordinates.
[Q2 - Part 3] Iteration Repetition Procedure
Repeat assignment and update steps iteratively until cluster assignments remain unchanged between consecutive iterations.
[Q2 - Part 3] Recognizing Convergence Concept
Convergence is recognized because the assignments in the latest iteration are identical to the previous one, so the centroids no longer move.
[Q2 - Part 3] Final SSE Calculation Method
Formula SSE = sum over clusters of sum over points of squared distance to that cluster's centroid. Steps: compute each point's squared distance to its final centroid, sum within each cluster, then sum across clusters.
[Q3 - Part 1] Agglomerative Clustering Procedure
Repeatedly find the smallest off-diagonal distance in the current distance matrix and merge that pair at that height.
[Q3 - Part 1] Updating Matrix Under Complete Linkage
Distance from a merged cluster to any other cluster equals the maximum of the member-to-member distances, then drop old rows/columns and add the new cluster.
[Q3 - Part 1] Complete Linkage Repetition
Repeat matrix updates and merges until only one cluster remains, with the final merge height equal to the last remaining matrix entry.
[Q3 - Part 1] Drawing the Dendrogram Procedure
Place leaves at height 0 and draw each merge as a horizontal bracket at its corresponding merge height.
[Q3 - Part 1] Interpreting the Two-Cluster Cut
Cut the dendrogram between the second and third merge heights to yield two cohesive groups where group diameter is bounded by the merge height and inter-group distance is large.
[Q4 - Part 1] Epsilon-Neighborhood Determination Rule
For each point, include itself plus every other point whose distance is at most epsilon, inclusive.
[Q4 - Part 2] Core Point Definition
A point that has at least MinPts points, including itself, within its epsilon-neighborhood.
[Q4 - Part 2] Border Point Definition
A point that has fewer than MinPts in its neighborhood but lies within epsilon of at least one core point.
[Q4 - Part 2] Noise Point Definition
A point that is neither a core point nor a border point.
[Q4 - Part 2] Classifying All Six Points Procedure
Count each neighborhood size, mark cores where size is at least MinPts, check if non-core points are within epsilon of a core, and label remaining as noise.
[Q4 - Part 3] Finding Clusters and Noise Procedure
Grow a cluster from a core point by connecting all density-reachable points, count resulting clusters, and label anything unassigned as noise.
[Q4 - Part 3] DBSCAN Dataset Preference Concept
DBSCAN is preferable for non-convex datasets like concentric rings or heavy noise because K-Means assumes spherical clusters and distorts centroids with outliers.
[Q4 - Part 3] Density-Reachability Concept
A point is density-reachable from a core point if there is a chain of core points connecting them within epsilon.
[Q4 - Part 3] Parameter Epsilon and MinPts Effects
Epsilon defines neighborhood radius and MinPts sets density thresholds, together controlling cluster granularity and noise identification.
[Q4 - Part 3] Noise Isolation in DBSCAN
DBSCAN explicitly isolates outliers as noise rather than forcing them into clusters, preserving cluster boundary integrity.
[Q5 - Part 1] Support Definition and Formula
Support = P(A union B) = count(A and B)/N, representing the proportion of transactions containing both items.
[Q5 - Part 1] Confidence Definition and Formula
Confidence = P(B|A) = support(A union B) / support(A), measuring rule reliability.
[Q5 - Part 1] Lift Definition and Formula
Lift = confidence / support(B) = P(A union B) / (P(A)P(B)), measuring observed joint support relative to independence.
[Q5 - Part 1] Lift Greater Than 1 Interpretation
Lift greater than 1 suggests a positive association where items occur together more often than expected by chance.
[Q5 - Part 2] Combinatorial Candidate Generation
A reason Apriori is expensive: d items yield up to 2^d minus 1 possible itemsets, creating massive candidate sets.
[Q5 - Part 2] Repeated Full-Database Scans
A reason Apriori is expensive: it scans the entire transaction set at every itemset length k to count candidate support.
[Q5 - Part 2] Hash-Based Pruning and Effort Reduction
Techniques like hash-based pruning, transaction reduction, or FP-Growth compress search effort or transaction sets to bypass candidate generation.
[Q5 - Part 2] Healthcare Application of Association Rules
Finding co-occurring symptoms, diagnoses, or adverse drug interactions in electronic health records.
[Q5 - Part 2] Cybersecurity Application of Association Rules
Finding co-occurring intrusion alert patterns or frequently co-visited web pages.
[Q5 - Part 3] Finding Frequent 1-Itemsets Method
Count each item across all transactions and prune those below the minimum support count threshold.
[Q5 - Part 3] Finding Frequent 2-Itemsets Method
Build candidate pairs only from frequent 1-itemsets, count occurrences across transactions, and prune below minimum support.
[Q5 - Part 3] Finding Frequent 3-Itemsets Method
Generate candidates, check that all subsets are frequent per the Apriori property, count supports, and write none if nothing qualifies.
[Q5 - Part 3] Listing Rules and Computing Confidence
List every rule with nonempty disjoint antecedent and consequent for each frequent itemset of size at least 2, and compute confidence.
[Q5 - Part 3] Computing Lift Method
Divide the rule's union support fraction by the product of individual support fractions for each rule meeting the confidence threshold.
[Q5 - Part 3] Lift Interpretation Below vs Above 1
Lift below 1 means items co-occur less often than chance due to high individual frequency, while lift above 1 indicates a genuine positive association.
[Q6 - Part 1] F1 Score Metric Definition
Measures the harmonic mean of precision and recall, balancing false positives and false negatives at a chosen threshold.
[Q6 - Part 1] Log-Loss Metric Definition
Measures the penalty for wrong probabilistic predictions, evaluating calibration where lower values are better.
[Q6 - Part 1] AUC Metric Definition
Measures the model's ability to rank positive instances higher than negatives across all possible classification thresholds.
[Q6 - Part 1] Random Forest vs Gradient Boosting Trade-Offs
Random Forest often yields strong F1 at default thresholds, while Gradient Boosting achieves superior probability calibration and ranking AUC.
[Q6 - Part 1] Justified Model Selection Procedure
Select Gradient Boosting for best calibration and discrimination with near-top F1, or Random Forest if F1 at the operating threshold is top priority.
[Q6 - Part 2] Stratified 5-Fold Cross-Validation Procedure
Partitions data into 5 folds preserving class distributions, trains on 4 folds and validates on 1, repeating five times so every observation is tested once.
[Q6 - Part 2] When Stratification Matters
Stratification matters for small or class-imbalanced datasets because it preserves the overall class distribution in every fold.
[Q6 - Part 2] Obtaining Final Cross-Validation Estimate
The final performance estimate is calculated as the arithmetic mean of the evaluation metric across all 5 validation folds.
[Q6 - Part 3] Usefulness of Identical Cross-Validation Folds
They create a paired comparison that removes variance from random splits, reflecting true model behavior differences.
[Q6 - Part 3] Testing Statistical Difference Between Models
To prove model B is better than A, mean differences alone are insufficient; you must analyze fold-by-fold accuracy differences.
[Q6 - Part 3] Statistical Tests for Model Comparison
Apply a paired t-test or Wilcoxon signed-rank test on fold-by-fold accuracy differences to establish statistical significance.
[Q6 - Part 3] Why Accuracy Is Misleading with Imbalance
When 3 percent of cases are positive, a trivial classifier predicting all negative gets 97 percent accuracy while catching 0 percent of positives.
[Q6 - Part 3] Informative Metrics for Rare Positives
PR-AUC or F1 are more informative because they evaluate precision and recall on the rare positive class without being inflated by true negatives.
[Q7 - Part 1] Blank 1 KMeans Initialization Code
km = KMeans(n_clusters=4, n_init=5, random_state=7) for fitting K-Means with 4 clusters, 5 initializations, and random state 7.
[Q7 - Part 1] Blank 2 Fit Predict Code
pred = km.fit_predict(X) to fit the model and return cluster label predictions for feature matrix X.
[Q7 - Part 1] Blank 3 Cluster Centers Code
print("Centroids:", km.cluster_centers_) to output the final coordinates of the cluster centroids.
[Q7 - Part 1] Blank 4 Silhouette Score Code
sil = silhouette_score(X, pred) to compute the internal validation metric based on cluster cohesion and separation.
[Q7 - Part 1] Blank 5 Adjusted Rand Score Code
ari = adjusted_rand_score(y, pred) to compute the external validation metric comparing predictions against true labels y.
[Q7 - Part 1] Blank 6 SSE Range Loop Code
for k in range(2, 8) to iterate SSE calculation for K values from 2 through 7 inclusive, accounting for exclusive upper bounds.
[Q7 - Part 1] Blank 7 Model Inertia Code
sse.append(model.inertia_) to store the sum of squared distances of samples to their closest cluster center.
[Q7 - Part 1] Blank 8 DBSCAN Initialization Code
db = DBSCAN(eps=0.8, min_samples=4) to initialize DBSCAN with epsilon 0.8 and minimum samples 4.
[Q7 - Part 1] Blank 9 Noise Count Code
noise_count = (db_labels == -1).sum() to count noise points since DBSCAN designates noise labels as -1.
[Q7 - Part 1] Blank 10 Cluster Count Code
cluster_count = len(set(db_labels)) - (1 if -1 in db_labels else 0) to exclude the noise label from the total cluster count.