Why naive Bayes model do not take as categorical vector as outcome

r
naive_bayes

#1

I am currently building a model using naive Bayes and I have not given a categorical variable as output as compared to other classifier it always take the categorical output if we do not give categorical output it gives error but naive Bayes gives no error I want to know why this happened.

rain<-read.csv(“train2.csv”)
test<-read.csv(“test2.csv”)

test$Survived<-NA
combinedData <- rbind(train,test)
new_train <- combinedData[1:891,]
new_test <- combinedData[892:1309,]
require(1071)

m1<-naiveBayes(new_train[,-2],new_train[,2],laplace=3)


#2

@harry-yes it is true that while taking the the output variable it is not necessary that it will take categorical variable if you give non categorical output it will not give any error but it will also not create any levels to output which necessary for a classifier to classify.So almost it is necessary to give categorical output.

Hope this helps!
Regards,
hinduja1234