Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to print value in list in R

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles