n<-1
a<-as.vector(length(s))
for (i in s ) {
print(i)
test$result<-ifelse(test$pred>i,1,0)
a[n]<-confusionMatrix(test$result,test$churn,positive = "1")$overall[2]
print(n)
n=n+1
}
max(a)
How do iget the threshold value between the above range if i run the code, I get this error
Error in:
$<-.data.frame
(*tmp*
, "result", value = logical(0)) : replacement has 0 rows, data has 3892