
Last chance! 50% off unlimited learning
Sale ends in
Calculates weighted precision, see https://en.wikipedia.org/wiki/Precision_and_recall for the (unweighted) version. The higher, the better.
precision(actual, predicted, w = NULL, ...)
Observed values (0 or 1).
Predicted values (0 or 1).
Optional case weights.
Further arguments passed to weighted_mean
.
A numeric vector of length one.
# NOT RUN {
precision(c(0, 0, 1, 1), c(0, 0, 1, 1))
precision(c(1, 0, 0, 1), c(0, 0, 1, 1))
precision(c(1, 0, 0, 1), c(0, 0, 1, 1), w = 1:4)
# }
Run the code above in your browser using DataLab