ROSE软件包中的潜在缺陷:R中的准确度、召回率和准确度差异
当我使用Rose库计算度量值时,我得到了召回率、精确度和F1的度量值。然而,当我手动计算召回率和精确度时,它们是不同的。为什么ROSE软件包中的潜在缺陷:R中的准确度、召回率和准确度差异,r,debugging,machine-learning,statistics,precision-recall,R,Debugging,Machine Learning,Statistics,Precision Recall,当我使用Rose库计算度量值时,我得到了召回率、精确度和F1的度量值。然而,当我手动计算召回率和精确度时,它们是不同的。为什么 install.packages("ROSE") library(ROSE) library(rpart) s = sample(957,200) training = data[-s,] test = data[s,] ### Rose treeimb <- rpart(Riskdrinker ~ ., data = training) pred.tr
install.packages("ROSE")
library(ROSE)
library(rpart)
s = sample(957,200)
training = data[-s,]
test = data[s,]
### Rose
treeimb <- rpart(Riskdrinker ~ ., data = training)
pred.treeimb <- predict(treeimb, newdata = test)
accuracy.meas(test$Riskdrinker, pred.treeimb[,2])
install.packages(“ROSE”)
图书馆(玫瑰)
图书馆(rpart)
s=样本(957200)
培训=数据[-s,]
测试=数据[s,]
###玫瑰
treeimb看起来像是ROSE
库有一个bug,然后:
精度:0.919召回率:0.943 F:0.465
因为max(p,r)>=f>=min(p,r)
也许你可以修复这个bug,并向作者发送一个补丁?我用Rose软件包做了一些实验,发现他们确实做得不对
以下是其.meas函数的一些打印:
negatives: 21.8284728768508
n.negatives 45
postives 135.677199132703
n.positives 155
TP: 143
FP 16
TN 29
FN 12
与我的表格相比,这是一个混乱矩阵
pred <- predict(treeimb, newdata = test, type="class")
confMat <- table(pred, test$Riskdrinker)
Reference
Prediction Ja Nej
Ja 29 12
Nej 16 143
pred:max(p,r)>=f>=min(p,r)是什么意思?f值必须始终在精度和召回率之间;它不能小于或大于这两个界限。因此,ROSE报告的F值、精度和召回率中至少有一个是错误的。我已经提出并提交了一个准确的新版本。正在等待Nicola的答复。嘿,Anony,我从logreg得到了这些结果。准确率93分,回忆率88分,F分45分。它们与F分数一致吗?我计算了F分数:顺便说一句,0.465*2在0.919和0.943之间
pred <- predict(treeimb, newdata = test, type="class")
confMat <- table(pred, test$Riskdrinker)
Reference
Prediction Ja Nej
Ja 29 12
Nej 16 143