如何使用multiClassSummary()函数提供精确度量?

时间:2018-04-08 14:18:12

标签: r r-caret confusion-matrix

R中的当前multiClassSummary()函数提供了没有精度的性能参数,例如如下:

示例:

predicted <-  matrix(rnorm(50), ncol = 5)
observed <- rnorm(10)
apply(predicted, 2, postResample, obs = observed)
classes <- c("class1", "class2")
set.seed(1)
dat <- data.frame(obs =  factor(sample(classes, 50, replace = TRUE)),
              pred = factor(sample(classes, 50, replace = TRUE)),
              class1 = runif(50), class2 = runif(50))
multiClassSummary(dat,lev=classes)

结果:

          logLoss               AUC          Accuracy             Kappa 
        0.6119378         0.4780844         0.6000000         0.1638796 
               F1       Sensitivity       Specificity    Pos_Pred_Value 
        0.6774194         0.7500000         0.4090909         0.6176471 
   Neg_Pred_Value    Detection_Rate Balanced_Accuracy 
        0.5625000         0.4200000         0.5795455 

有没有办法提供精确度?

Pos_Pred_Value 作为class1的精度, Neg_Pre_Value 作为class2的精度是否正确?

0 个答案:

没有答案