I have this modified iris data-set which comprises of first 100 rows i.e only the 'setosa' and 'versicolor' species. I have randomized the rows using sample() function:
iris1[sample(nrow(iris1)),]->iris1
The i've divided the data-set in 65:35 ratio using the sample.split function from caTools package:
sample.split(iris1$Species,SplitRatio = 0.65)->mysplit
subset(iris1,mysplit==T)->train
subset(iris1,mysplit==F)->test
Following which i've built the rpart model on top of "train" set and predicted the values on "test" set:
rpart(Species~.,data=train)->mod1
predict(mod1,test,type = "class")->result1
Now, i would want to find the accuracy of prediction on the test set, how can i do that?