Kmean PGM
Kmean PGM
data(iris)
print("Silhouette Score:")
print(summary(silhouette_avg))
cat("The Silhouette Score measures how similar a data point is to its own cluster compared
to other clusters. A score closer to +1 indicates better clustering, -1 indicates poor
clustering, and 0 indicates overlapping clusters.\n")
# Plot the clusters (using factoextra - highly recommended for k-means visualization)
table(iris$Species, kmeans_result$cluster)
print(paste("\nCluster", i, ":"))