Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Clustering using R Hi. I wish to use the elbow and silhouette method and plot the graph for the following data but keep getting an
Clustering using R
Hi. I wish to use the elbow and silhouette method and plot the graph for the following data but keep getting an error. Please tell me how i can correct the codes.Point 1: (7,3)
Point 2: (4,5)
Point 3: (2,4)
Point 4: (0,1)
Point 5: (9,7)
Point 6: (6,8)
Here are my codes:
X <- matrix(c(7,3,4,5,2,4,0,1,9,7,6,8),nrow=6,byrow= TRUE)
res.k <- kmeans( X, centers= X[c(5,6),], algorithm = "Lloyd")
library(factoextra)
library(NbClust)
library(cluster)
fviz_nbclust(X, kmeans, method= "wss")
fviz_nbclust(X, kmeans, method= "silhouette")
fviz_cluster(res.k, X, ellipse.type= "norm")
The last three codes here give an error, please correct them. Thanks
The points are given. Need to find the optimal amount of clusters using R. So use the elbow and silhouette method on R
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started