@KumarP wrote:
for(i in seq(from=0.05, to=0.2, by=0.01)){ print(i) prediction <- as.numeric(test_pred >= i) print(prediction) TP<-sum(ifelse(prediction==test_label & test_label ==1,1,0)) TN <-sum(ifelse(prediction==test_label & test_label ==0,0,1)) FP <-sum(ifelse(prediction!=test_label & test_label ==1,1,0)) FN <- sum(ifelse(prediction!=test_label & test_label ==0,0,1)) precision <- (TP / TP + FP) recall <- (TP / TP + FN) F1 <- (2 * precision * recall) / (precision + recall) print(precision) print(recall) print(F1) }
I need my value print in list , not one by one print. so I can check best value for Precision , Recall, F1.
Posts: 5
Participants: 2