Description Usage Arguments Value Note See Also Examples

View source: R/sperrorest_error.R

Calculate a variety of accuracy measures from observations and predictions of numerical and categorical response variables.

1 | ```
err_default(obs, pred)
``` |

`obs` |
factor, logical, or numeric vector with observations |

`pred` |
factor, logical, or numeric vector with predictions. Must be of
same type as |

A list with (currently) the following components, depending on the type of prediction problem:

`'hard' classification` |
misclassification error, overall accuracy; if two classes, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), kappa |

`'soft' classification` |
area under the ROC curve, error and accuracy at a obs>0.5 dichotomization, false-positive rate (FPR; 1-specificity) at 70, 80 and 90 percent sensitivity, true-positive rate (sensitivity) at 80, 90 and 95 percent specificity |

`regression` |
bias, standard deviation, mean squared error, MAD (mad), median, interquartile range (IQR) of residuals |

`NA`

values are currently not handled by this function,
i.e. they will result in an error.

ROCR

1 2 3 4 5 6 7 8 | ```
obs <- rnorm(1000)
# Two mock (soft) classification examples:
err_default( obs > 0, rnorm(1000) ) # just noise
err_default( obs > 0, obs + rnorm(1000) ) # some discrimination
# Three mock regression examples:
err_default( obs, rnorm(1000) ) # just noise, but no bias
err_default( obs, obs + rnorm(1000) ) # some association, no bias
err_default( obs, obs + 1 ) # perfect correlation, but with bias
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.