library("mlbench")
library("MASS")
learn <- as.data.frame(mlbench.twonorm(100))
test <- as.data.frame(mlbench.twonorm(1000))
mlda <- lda(classes ~ ., data=learn)
mslda <- slda(classes ~ ., data=learn)
print(mean(predict(mlda, newdata=test)$class != test$classes))
print(mean(predict(mslda, newdata=test)$class != test$classes))
Run the code above in your browser using DataLab