Machine Learning, Artificial Intelligence, Technology, Python, Data Science.
'k-means++',max_iter = 300, random_state = 2021) KMeans_model.fit(df) # storing the centroids centroids = KMeans_model.cluster_centers_ centroids_df = pd.DataFrame(centroids,columns = ["X","Y"]) # getting the labels/classes labels = KMeans_model.labels_ df = pd.DataFrame(df) df["labels"] = labels