Please write it step by step in Python
This task is to create a K-means Algorithm from scratch.
K-means algorithm consists of the following steps:
1. We initialize k centroids randomly.
2. Calculate the sum of squared deviations.
3. Assign a centroid to each of the observations.
4. Calculate the sum of total errors and compare it with the sum in the previous iteration.
5. If the error decreases, recalculate centroids and repeat the process.
I will expect 4 classes as following:
1. Clustering_base.py
2. Create_dataset_sklearn.py
3. driver_kmeans.py
4. kmeans.py