lundi 2 novembre 2015

R : Error in prediction with naiveBayes

When I try to do the prediction with naiveBayes, R show this error:

Error: protect(): overflow protection stack.

This is my code for the prediction

#Naive Bayes
train<-read.csv("/Users/myuser/Desktop/folder/training.csv")
test<-read.csv("/Users/myuser/Desktop/folder/testing.csv")
train$data<-as.factor(train$data)
test$data<-as.factor(test$data)
model<-naiveBayes(type ~.,data=train,laplace=5)
predicted<-predict(model,test)
result<-cbind(predicted,test)
write.csv(result,"results.csv")

Aucun commentaire:

Enregistrer un commentaire