This is my code:
library(MASS)
library(mlbench)
library(caret)
library(class)
data(Glass)
Glass <- data.frame(Glass)
Glass <- na.omit(Glass)
Glass$Type = as.factor(Glass$Type)
x = as.matrix(Glass[,names(Glass) != "Type"])
mode(x) = "numeric"
Glass[,names(Glass) != "Type"] <-x
ind <- sample(2, nrow(Glass), replace = TRUE, prob=c(0.8, 0.2))
train <- Glass[ind == 1,]
test <- Glass[ind == 2,]
train[,names(Glass) != "Type"] <- apply(train[,names(Glass) != "Type"], 2, jitter)
And I keep getting this following error:
Error in qda.default(x, grouping, ...) : some group is too small for 'qda'