search for: iris_train

Displaying 1 result from an estimated 1 matches for "iris_train".

2009 Mar 04
0
Error in -class : invalid argument to unary operator
...t;-sample(nrow(wine), floor(nrow(wine) * 0.5)) wine_training <- wine[split, ] wine_testing <- iris[-split, ] naive_bayes <-naiveBayes(class~.,data=wine_training) x_testing <- subset(wine_testing, select = -class) y_testing <- wine_testing$class # just grab Species variable of iris_training pred <- predict(naive_bayes, x_testing) tab<-table(pred, y_testing) ca <- classAgreement(tab) print(tab) print(ca) when I enter this code in I get the error Error in -class : invalid argument to unary operator If anybody could give me anysort of advice this would be most welc...