Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Implementing on Customers Dataset | Hierarchical Clustering
Cluster Analysis
course content

Course Content

Cluster Analysis

Cluster Analysis

1. Clustering Fundamentals
2. Core Concepts
3. K-Means
4. Hierarchical Clustering
5. DBSCAN
6. GMMs

book
Implementing on Customers Dataset

You'll be using the credit card customer data. Before clustering the data, you should follow these steps:

  1. Load the data: use pandas to load the CSV file;

  2. Handle missing values: if necessary, impute or remove rows with missing data;

  3. Feature scaling: apply StandardScaler to scale the features. This is important because hierarchical clustering uses distance calculations;

  4. Dimensionality reduction (PCA): apply principal component analysis (PCA) to reduce the data to two dimensions. This will make it easier to visualize the clusters.

Interpreting the Dendrogram

First, you should analyze the dendrogram to determine a suitable number of clusters. Look for large vertical distances that are not crossed by any extended horizontal lines.

Next, you can plot the data points after PCA, coloring them according to the cluster labels obtained by cutting the dendrogram at the chosen height.

Finally, you should examine the characteristics of the resulting clusters. It is recommended to look at the average values of the original features (before PCA) for each cluster to understand how the clusters differ.

Conclusion

Hierarchical clustering is a powerful technique when you don't want to pre-specify the number of clusters or when you need to understand the hierarchical relationships between data points. However, it can be computationally expensive for very large datasets, and choosing the right linkage method and the optimal number of clusters requires careful consideration and often involves a combination of quantitative methods and domain expertise.

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 4
We're sorry to hear that something went wrong. What happened?
some-alt