Unsupervised Learning - Kmeans Week 11 Challenge
Q1.
K-means algorithm is a simple iterative machine learning algorithm used in unsupervised learning. The basic idea behind K-means algorithm is to separate data into clusters on the basis of similarity and henceforth identfy the underlying patterns. To achieve this objective, K-means looks for a fixed number (k) of clusters in a datasets. Clusters can be referred to as a collection of datapoints aggregated based on certian similarities.
Steps for k-means clustering
1) Random selection of ‘K’ cluster.
2) Calculate the distance between each data point and cluster centers.
3) Assigning the datapoints to the cluster centre to which the distance is minimum.
4) Recalculate the new cluster center.
5) Reassign the datapoints to the closest new cluster centers.
6) Repeat until data points stay in the same cluster.
Pros:
- Fast, robust and easy to grasp.
- Scales to large dataset.
- The algorithm is relatively efficient.
- Ideal when data set are distinct.
- Generalizes well to clusters of different size and shapes.
Cons:
- Number of clusters 'k' have to be choosen manually.
- Dependent on initial values.
- Sensitive to outliers.
- Trouble working with overlapping data.
Q2.
Summary and Conclusion:
- KMeans Clustering of the dataset was performed and scatter plots were created.
- Hierarchical Clustering was performed and scatter plots were created.
- In both the clustering method the optimum number of clusters were found to be 3.
- The Clusters form in both the algorithms were exactly the same