Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

precision

Precision


Description

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)

Usage

precision(actual, predicted)

Arguments

actual

The ground truth binary numeric vector containing 1 for the positive class and 0 for the negative class.

predicted

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.

See Also

Examples

actual <- c(1, 1, 1, 0, 0, 0)
predicted <- c(1, 1, 1, 1, 1, 1)
precision(actual, predicted)

Metrics

Evaluation Metrics for Machine Learning

v0.1.4
BSD_3_clause + file LICENSE
Authors
Ben Hamner [aut, cph], Michael Frasco [aut, cre], Erin LeDell [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.