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

后端 未结 7 1292
不思量自难忘°
不思量自难忘° 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:20

    confusionMatrix() from caret package can be used along with a proper optional field "Positive" specifying which factor should be taken as positive factor.

    confusionMatrix(predicted, Funded, mode = "prec_recall", positive="1")
    

    This code will also give additional values such as F-statistic, Accuracy, etc.

提交回复
热议问题