选取预测概率的分割点
cutoff<- function(n,p){
pp<-1
i<-0
while (pp>=0.02) {
model.predfu<-rep("failure",n)
model.predfu[model4.prob > 0.2 + i*0.001]<-"victory"
pp<- abs(p-sum(model.predfu=="failure")/n)
i<-i+1
}
cut<-0.2+(i-1)*0.001
return(cut)
}
原文地址:https://www.cnblogs.com/xihehe/p/8298055.html
时间: 2024-10-11 11:54:25