Easy way of counting precision, recall and F1-score in R

后端 未结 7 1291
不思量自难忘°
不思量自难忘° 2021-01-31 04:45

I am using an rpart classifier in R. The question is - I would want to test the trained classifier on a test data. This is fine - I can use the predict.rpart<

7条回答
  •  旧巷少年郎
    2021-01-31 05:34

    We can simply get F1 value from caret's confusionMatrix function

    result <- confusionMatrix(Prediction, Lable)
    
    # View confusion matrix overall
    result 
    
    # F1 value
    result$byClass[7] 
    

提交回复
热议问题