Fatskills
Practice. Master. Repeat.
Study Guide: Business Analytics 101: Machine Learning Fundamentals Clustering kMeans Hierarchical DBSCAN Silhouette Score
Source: https://www.fatskills.com/business-analytics/chapter/business-analytics-busanalytics-machine-learning-fundamentals-clustering-kmeans-hierarchical-dbscan-silhouette-score

Business Analytics 101: Machine Learning Fundamentals Clustering kMeans Hierarchical DBSCAN Silhouette Score

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~4 min read

What This Is

Clustering is a business analytics technique used to group similar data points into clusters based on their characteristics. This helps organizations segment their customers, identify patterns in customer behavior, and make informed decisions. For example, a retail company might use clustering to segment its customers based on their purchasing habits, such as age, location, and spending patterns.

Key Formulas & Metrics

  • K-Means Clustering:
  • Centroid (μ) = (1/n) Σxᵢ – the mean of the cluster.
  • Distance (d) = √((xᵢ - μ)² + (yᵢ - μ)²) – the Euclidean distance between a data point and the centroid.
  • Silhouette Score (S) = (b - a) / max(a, b) – a measure of how similar an object is to its own cluster compared to other clusters.
  • Hierarchical Clustering:
  • Dendrogram – a tree-like diagram showing the hierarchical structure of the clusters.
  • Agglomerative Coefficient (AC) = (1 - (dᵢ / dᵢₘᵃₓ)) – a measure of the similarity between two clusters.
  • DBSCAN (Density-Based Spatial Clustering of Applications with Noise):
  • ε (epsilon) – the maximum distance between two points in a cluster.
  • MinPts – the minimum number of points required to form a dense region.
  • Evaluation Metrics:
  • Calinski-Harabasz Index (CHI) = (B / W) / ((n - 1) / (N - k)) – a measure of the ratio of between-cluster variance to within-cluster variance.
  • Davies-Bouldin Index (DBI) = (1 / n) Σmax(dᵢᵀ / dᵢ) – a measure of the similarity between clusters.

Step-by-Step Procedure

  1. Choose a clustering algorithm: Select the most suitable algorithm based on the data type and characteristics (e.g., K-Means for numerical data, Hierarchical for categorical data).
  2. Determine the number of clusters (k): Use techniques such as the elbow method, silhouette analysis, or cross-validation to determine the optimal number of clusters.
  3. Select initial centroids: Choose initial centroids for K-Means or select a linkage criterion for Hierarchical clustering.
  4. Assign data points to clusters: Use the clustering algorithm to assign data points to clusters based on their characteristics.
  5. Evaluate the clustering results: Use metrics such as the Silhouette score, Calinski-Harabasz Index, or Davies-Bouldin Index to evaluate the quality of the clustering results.

Common Mistakes

  • Mistake: Using the wrong clustering algorithm for the data type.
  • Correction: Choose an algorithm that is suitable for the data type (e.g., K-Means for numerical data, Hierarchical for categorical data).
  • Mistake: Not evaluating the clustering results using multiple metrics.
  • Correction: Use multiple metrics to evaluate the quality of the clustering results and choose the best clustering algorithm.
  • Mistake: Not considering the number of clusters (k) when selecting the clustering algorithm.
  • Correction: Use techniques such as the elbow method, silhouette analysis, or cross-validation to determine the optimal number of clusters.

Software / Tool Tips

  • Python with scikit-learn: Use the KMeans, AgglomerativeClustering, and DBSCAN classes to implement K-Means, Hierarchical, and DBSCAN clustering, respectively.
  • R: Use the kmeans, hclust, and dbscan functions to implement K-Means, Hierarchical, and DBSCAN clustering, respectively.
  • Tableau: Use the Clustering feature to create clusters based on various dimensions and measures.

Quick Practice Problem

Problem: A retail company wants to segment its customers based on their purchasing habits. The company has collected data on customer age, location, and spending patterns. Use the Silhouette score to evaluate the quality of the clustering results.

Answer: The Silhouette score is 0.8, indicating that the clustering results are good.

Last-Minute Cram Sheet

  1. K-Means Clustering: a type of unsupervised learning algorithm that partitions data into k clusters based on their characteristics.
  2. Hierarchical Clustering: a type of unsupervised learning algorithm that builds a hierarchy of clusters by merging or splitting existing clusters.
  3. DBSCAN (Density-Based Spatial Clustering of Applications with Noise): a type of unsupervised learning algorithm that groups data points into clusters based on their density and proximity.
  4. Silhouette Score (S): a measure of how similar an object is to its own cluster compared to other clusters.
  5. Calinski-Harabasz Index (CHI): a measure of the ratio of between-cluster variance to within-cluster variance.
  6. Davies-Bouldin Index (DBI): a measure of the similarity between clusters.
  7. ε (epsilon): the maximum distance between two points in a cluster.
  8. MinPts: the minimum number of points required to form a dense region.
  9. Agglomerative Coefficient (AC): a measure of the similarity between two clusters.
  10. Dendrogram: a tree-like diagram showing the hierarchical structure of the clusters.


ADVERTISEMENT