R/mi_get_miss.R

Defines functions mi_get_miss

Documented in mi_get_miss

#' Observe the distribution of the false response of the test set.
#' @param predict An R6 class `PredictionClassif`.
#' @importFrom data.table as.data.table
#' @importFrom dplyr filter group_by count
#' @importFrom magrittr %>% %T>%
#' @export
#' @return A tibble data frame that records the number of wrong predictions for each category ID
mi_get_miss <- function(predict) {
  stopifnot(any(class(predict) == "PredictionClassif"))
  result <- predict %>%
    as.data.table() %>%
    filter("truth" != "response") %>%
    group_by("truth") %>%
    count()
}

Try the MantaID package in your browser

Any scripts or data that you put into this service are public.

MantaID documentation built on Sept. 11, 2024, 6 p.m.