选取预测概率的分割点
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)
}