0

How do I calculate the accuracy of my algorithm in R?

Below, I created a data partition wherein 75% is for training and remaining is for testing:

splitIndex <- createDataPartition(Iris$CLASS, p = .75, list = FALSE, times = 1)
trainDF <- totalbasefile[ splitIndex,]
testDF  <- totalbasefile[-splitIndex,]
myFS<-fscaret(trainDF, testDF, myTimeLimit = 10, preprocessData=TRUE,
              Used.funcRegPred = 'gbm', with.labels=TRUE,
              supress.output=FALSE, no.cores=2)

What should I do next to determine the accuracy of my GBM algorithm? I have used pls algorithm as well by changing using Used.funcRegPred = 'pls' I wanted to know ids there any function that could help to estimate accuracy of any algorithm be it pls or pcr included within the caret package.

Thanks!

bug
  • 1
  • 1
  • Be sure to include all the relevant packages you are using in your question. Also, you should include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to make it easier to help you. – MrFlick Nov 11 '15 at 18:51
  • i have used caret and fscaret .. i also tried using gbm packages. – bug Nov 11 '15 at 19:44
  • It depends on what you define as "accuracy". There is no universally best accuracy metric. What metric are you using? – alexwhitworth Nov 11 '15 at 19:46
  • True positive rate (TPR) is what i am considering as accuracy for this problem – bug Nov 11 '15 at 19:50
  • You do know that fscaret is only doing feature selection? if you want to use the confusionmatrix you need to run your model trough caret. – phiver Nov 12 '15 at 09:30

0 Answers0