I used randomForest to classify 6 animal behaviours (eg. Standing, Walking, Swimming etc.) based on 8 variables (different body postures and movement).
The MDSplot in the randomForest package gives me this output and I have problems in interpreting the result. I did a PCA on the same data and got a nice seperation between all the classes in PC1 and PC2 already, but here Dim1 and Dim2 seem to just seperate 3 behaviours. Does this mean that these three behaviours are the more dissimilar than all other behaviours (so MDS tries to find the greatest dissimilarity between variables, but not necessarily all variables in the first step)? What does the positioning of the three clusters (as e.g in Dim1 and Dim2) indicate? Since I'm rather new to R I also have problems plotting a legend to this plot (however I have an idea what the different colours mean), but maybe somebody could help? Thanks a lot!!
I add a plot made with the ClassCenter function in RandomForest. This function also uses the proximity matrix (same as in the MDS Plot) for plotting the prototypes. But just from looking at the datapoints for the six different behaviours, I can't understand why the proximity matrix would plot my prototypes as it does. I also tried the classcenter function with the iris data and it works. But it seems like it doesn't work for my data...
Here is the code I used for this plot
be.rf <- randomForest(Behaviour~., data=be, prox=TRUE, importance=TRUE) class1 <- classCenter(be[,-1], be[,1], be.rf$prox) Protoplot <- plot(be[,4], be[,7], pch=21, xlab=names(be), ylab=names(be), bg=c("red", "green", "blue", "yellow", "turquoise", "orange") [as.numeric(factor(be$Behaviour))]) points(class1[,4], class1[,7], pch=21, cex=2, bg=c("red", "green", "blue", "yellow", "turquoise", "orange"))
My class column is the first one, followed by 8 predictors. I plotted two of the best predictor variables as x and y.