Description Usage Arguments Value See Also Examples
View source: R/metric_PrecisionRecall.R
Return Weighted mean of precisions achieved at each threshold
1 | metric_PrecisionRecall(actual, predicted, weight = NULL, na.rm = FALSE)
|
actual |
Array[Numeric] - 0 or 1 - Values we are aiming to predict. |
predicted |
Array[Numeric] / DataFrame[Numeric] - Between 0 and 1 - Values that we have predicted. |
weight |
Optional: Array[Numeric] - Weighting of predictions. If NULL even weighting is used. |
na.rm |
logical. Should missing values be removed? |
Weighted mean of precisions achieved at each threshold, with the increase in recall from the previous threshold used as the weight. Single value if predicted
is vector. Named list if predicted
is dataframe.
1 2 3 4 5 | data <- data.frame(x1=runif(100), x2=runif(100), noise=rnorm(100, sd=0.2)) %>%
mutate(target=ifelse(x1 + noise>0.5, 1, 0))
metric_PrecisionRecall(actual=data$target, predicted=data$x1)
metric_PrecisionRecall(actual=data$target, predicted=data[c("x1","x2")])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.