trainSet <- sample(1:150, 100)
distData <- classDist(iris[trainSet, 1:4],
iris$Species[trainSet])
newDist <- predict(distData,
iris[-trainSet, 1:4])
splom(newDist, groups = iris$Species[-trainSet])
Run the code above in your browser using DataLab