Last chance! 50% off unlimited learning
Sale ends in
precision
computes proportion of observations predicted to be in the
positive class (i.e. the element in predicted
equals 1)
that actually belong to the positive class (i.e. the element
in actual
equals 1)
precision(actual, predicted)
The ground truth binary numeric vector containing 1 for the positive class and 0 for the negative class.
The predicted binary numeric vector containing 1 for the positive
class and 0 for the negative class. Each element represents the
prediction for the corresponding element in actual
.
# NOT RUN {
actual <- c(1, 1, 1, 0, 0, 0)
predicted <- c(1, 1, 1, 1, 1, 1)
precision(actual, predicted)
# }
Run the code above in your browser using DataLab