Unsupervised Learning - Kmeans Week 11 Challenge
1.How does similarity is calculated if data is categorical in nature
- Brief introduction to K-means algorithm and similarity feature determination
a) K-means algorithm and similarity feature determination

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.

Different similarity calculation methods are listed below:

*Source: Shirkhorshidi AS, Aghabozorgi S, Wah TY (2015). A Comparison Study on Similarity and Dissimilarity Measures in Clustering Continuous Data.
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.
b) Implementation of K-means algorithm in python for automobile dataset

2.Implement K-means for “Car dataset” and come up with the business insights