MLmetrics
MLmetrics copied to clipboard
Inconsistencies and errors with `Precision()`
Hello,
Firstly, thanks for developing this package. I have found some bugs with the Precision()
function when all the true or predicted values equal the positive value. There is also unexpected behaviour when none of the true values are the "positive value".
See below a minimal example;
Precision(y_true = c(1, 1, 1, 1),
y_pred = c(1, 0, 1, 0),
positive = "1")
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
Precision(y_true = c(1, 0, 1, 0),
y_pred = c(1, 1, 1, 1),
positive = "0")
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
Precision(y_true = c(0, 0, 0, 0),
y_pred = c(1, 0, 1, 0),
positive = "1")
[1] NA
Hope this helps,