internalGetMetrics: Calculate overall performance metrics

Description Usage Arguments Details Value See Also Examples

View source: R/nbc4va_internal.R

Description

A vector providing overall performance metrics based on input predicted and observed cases.

Usage

1
2
3
internalGetMetrics(pred, obs, causes = unique(c(pred, obs)),
  csmfa.obs = NULL, causeMetrics = internalGetCauseMetrics(pred, obs,
  causes))

Arguments

pred

Chracter vector of predicted causes for each case.

obs

Character vector of observed causes for each case.

causes

Character vector of all possible causes including ones that are not in the pred or obs.

csmfa.obs

A character vector of the true causes for calculating the CSMF accuracy.

causeMetrics

Dataframe of a performance metrics per cause (see internalGetCauseMetrics):

  • Columns: Cause, TruePositives, TrueNegatives, FalsePositives, FalseNegatives, PredictedFrequency, ObservedFrequency, Sensitivity, CSMFpredicted, CSMFobserved

  • Cause (vectorof char): The unique causes from both the obs and pred inputs

  • TruePositives (vectorof double): The total number of true positives per cause

  • TrueNegatives (vectorof double): The total number of true negatives per cause

  • FalsePositives (vectorof double): The total number of false positives per cause

  • FalseNegatives (vectorof double): The total number of false negatives per cause

  • PredictedFrequency (vectorof double): The occurence of a cause in the pred input

  • ObservedFrequency (vectorof double): The occurence of a cause in the obs input

  • Sensitivity (vectorof double): the sensitivity for a cause

  • CSMFpredicted (vectorof double): the cause specific mortality fraction for a cause given the predicted deaths

  • CSMFobserved (vectorof double): the cause specific mortality fraction for a cause given the observed deaths

Details

Developer Note: Depends on the internalGetCSMFAcc function to get the CSMF Accuracy.

Value

metrics Named numeric vector of performance metrics (see Methods documentation):

See Also

Other internal functions: internalGetCSMFAcc, internalGetCSMFMaxError, internalGetCauseMetrics, internalNBC

Examples

1
2
3
4
library(nbc4va)
pred <- c("HIV", "Stroke", "HIV", "Stroke")
obs <- c("HIV", "HIV", "Stroke", "Stroke")
metrics <- nbc4va:::internalGetMetrics(pred, obs)

nbc4va documentation built on May 2, 2019, 1:42 p.m.