TD_KMeansPredict uses the k-means algorithm to predict the target class of unseen or new data.
The k-means algorithm calculates the distance between data points to determine the number of groups in a dataset based on the data point clusters.
TD_KMeansPredict function follows this process:
- Select the number of clusters (K).
- Initialize the centroids.
- Assign training data points to clusters based on their proximity to the different clusters
- Recalculate centroids.
- Repeat the process until the cluster assignments do not change a lot.
- Use k-means algorithm to predict the cluster assignments of unseen/test data.