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:
Comments
Post a Comment