R/validate-predictions.R

Defines functions validate_predictions

Documented in validate_predictions

#' Assert that model predictions are sensible
#'
#' This function tests that model predictions make sense. It is intended to be
#' run after new data has been scored, but before it has been submitted. We
#' might ensure that outputs are sensible, within an expected range, or do not
#' contain sensitive data. Failed assertions will raise an error. Upon success,
#' the md5 hash of the predictions will be returned.
#'
#' @param predictions A vector of model predictions
#'
#' @return The MD5 hash of the predictions
#' @export
#'
validate_predictions <- function(predictions) {
  assertthat::assert_that(all(predictions == "good" | predictions == "bad"))
  
  TRUE
}
mdneuzerling/DrakeModelling documentation built on June 26, 2020, 1:25 p.m.