r - Add extra penalty for each FP -


i familiar rocr package, , used following code

library(rocr) data(rocr.simple) pred <- prediction( rocr.simple$predictions, rocr.simple$labels) perf <- performance(pred,"tpr","fpr") plot(perf) 

but find optimal cutoff, need add penalty of 10 each fp, , 100 each tn

how can using rocr package?

i guess, found answer

  auc.tmp <- performance(res,"auc",cost.fp=100, cost.tn=10);  

in way can costs each cell in confusion matrix, still looking way obtain cutoffs


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -