# NOT RUN {
# }
# NOT RUN {
library(mlbench) # Location of the Sonar data set
library(mclust) # The cluster library
data(Sonar)
Sonar$Class <- 1*(Sonar$Class == "M")
#Train hierachical classifier
mc <- ClustClass(Class~.,Sonar,clustermethod=Mclust,clustermethod.control=list(G = 1:4))
#report the classification
pb <- predict(mc,Sonar)
print(table(1*(pb>0.0),Sonar$Class))
# }
Run the code above in your browser using DataLab