Error in table(prediksi, testing$Class) : all arguments must have the same length

Hi everyone... nc to see u all. i have problem with my r .. my first in r.. i want to tell u about my NB

#Input Data CreditcardFraud
dataku=read.delim("clipboard")
View(dataku)
#Install Package
install.packages("e1071")
install.packages("caret")
library(e1071)
library(caret)
#Membagi 2 data training dan data testing
sampel=sample(1:nrow(dataku),0.75*nrow(dataku),replace = TRUE)
training=data.frame(dataku)[sampel,]
testing=data.frame(dataku)[-sampel,]
#Permodelan Naive Bayes
modelNB=naiveBayes(Class~.,data=training)
#Melakukan Prediksi
prediksi=predict(modelNB,testing)
hasil=confusionMatrix(table(prediksi,testing$Class))

if i run the program in NB appear the messege

"Error in table(prediksi, testing$Class) :
all arguments must have the same length"

can you all helpme to fix the error.?
thankss
i hope your generosity.. sorry if my english is bad :)))

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.