Creating a classifier i get an error - all arguments must have the same length.
Wonder how to fix it?
classifier <- naiveBayes (x=trainset, y= train$Label)
prediction <- predict(classifier, newdata=testset)
cm <- table(test$Label, prediction)
Error in table(test$Label, prediction) :
all arguments must have the same length
UPD: Found it, the target variable should be factor