# Error while calculating metrics like AUC, ACC in R

I am trying to make predictions on my validation data using a decision tree model created with training data set. I am able to do that with success but, I am not able to calculate various metrics like Area under curve (AUC), and overall classification rate (ACC) using mmetric() command in R. Here is the screen shot with errors and commands that I used. Note: Right click the image and select view image to see it clearly. "t" is my training data set and "v" is validation data set.

Note: You can download my training data set "t" and validation data set "v" as a .csv files from here: Click here I used the same commands for a different data set and it worked perfectly, so could be this due to some problem with my data set.

Thanks,

P

-
what's dim(v)? Does v contain any missing data? –  Jonathan Christensen Dec 3 '12 at 23:37
Please post a reproducible example. You can create a toy dataset, or use one of the ones built into R (e.g. iris). –  Zach Dec 4 '12 at 1:55
@JonathanChristensen, I have updated the question as per ur needs. Regards, –  user16603 Dec 4 '12 at 22:27
@Zach this error is not reproducible for dataset that are in R-tool.(I mentioned that above!) this command works fine for iris data set. Regards –  user16603 Dec 4 '12 at 22:28
It is not clear to me whether you are having technical issues editing your questions or whether you are purposefully vandalizing them. If the latter, please stop. –  cardinal Dec 17 '12 at 0:57

You need to tell predict() to return classes and not probabilities:
vpredict=predict(tree,t,type="class")

The default for classification with predict.rpart() is to return a matrix with probabilities of each class. However, mmetric wants the classes.