create ROC from 10 different thresholds -


i have output svmlight has x=predictions (0.1,-0.6,1.2, -0.7...), y=actual class {+1,-1}. want create roc curve 10 specific different thresholds (let t vector contains 10 different threshold values). checked rocr package didn't see option supplying threshold vector. need calculate tpr , fpr each threshold value , plot. there other way ? new r programming.

rocr creates roc curve plotting tpr , fpr many different thresholds. can done 1 set of predictions , labels because if observation classified positive 1 threshold, classified positive @ lower threshold. found this paper helpful in explaining roc curves in more detail.

you can create plot follows in rocr x vector of predictions, , y vector of class labels:

pred <- prediction(x,y)  perf <- performance(pred,"tpr","fpr") plot(perf) 

if want access tpr , fpr associated thresholds, can examine performance object 'perf':

str(perf) 

the following answer shows how obtain threshold values in more detail:

https://stackoverflow.com/a/16347508/786220


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -