Data, Python, Machine Learning, Data Science, AI.
library(ggplot2) # Load the Iris dataset data(iris) # Perform K-means clustering with 3 clusters kmeans_result <- kmeans(iris[, 1:4], centers = 3) # Visualize the clusters fviz_cluster(kmeans_result, data = iris[, 1:4], geom = "point", frame.type = "norm", repel = TRUE) + ggtitle("K-means