I am developing model-based clustering.
First, I developed model-based clustering in R using "mclust." Next, I wanted to take 75% of the sample, re-run model-based clustering and compare the results with the results from the entire dataset using variation of information or rand index. However, I am getting stuck with the codes.
Here are the codes made available for variation of information on CRAN.
cl1 <-sample(1:30, 10, replace=TRUE) cl2 <- c(cl1[1:5], sample(1:3, 5, replace=TRUE)) vi.dist(cl1,cl2) vi.dist(cl1,cl2, parts=TRUE)
Here is how I developed my clustering solutions:
model based clustering solution using entire dataset and data is the name of my dataset using columns 18 to 22
random <- data[rbinom(nrow(data), 1,.75)==1,]
developed a random sample
model-based clustering using the random sample
cl1 <- (model$classification) cl2 <- (randommodel$classification) vi.dist(cl1,cl2)
my attempt at variation of information using R codes, result failed because
cl1 and cl2 are not the same length.
So, how do I make the two solutions the same length given that the two solutions have a different number of observations? Or, am I trying to use variation of information incorrectly?