Thursday, 8 December 2016

Hierarchial Clustering with Python

                                                            Hierarchial Clustering in python 

Wholesale dataset
The dataset consists of Products consumed by people in certain regions.The main objective  is to cluster the products consumed by people.

Dataset :

The dataset can be accessed by the following from the website UCI Machine Learning "https://archive.ics.uci.edu/ml/machine-learning-databases/00292/Wholesale%20customers%20data.csv"

Screen Shots of codes are as follows:

































Thus the above screen shots provides the sequential steps of the coding performed in python on the wholesale dataset  and the Output thereby obtained is dendogram.


Inference:

All the datapoints which are close together are formed as cluster.The cluster thus formed provides us an inference that People who buy a similar kind of products are grouped together in one cluster.
In the dendogram usually if we need to select the clusters we would take a horizontal and the maximum distance it can go or move up and down would be the best place to split which will also give us the number of clusters but again it depends on the business problem we have and how many clusters we want in our case the desired clustered are 11.







No comments:

Post a Comment