R/helper.R

Defines functions check_centers_param warn_prediction_useless

warn_prediction_useless = function(id) {
  msg = sprintf("Learner '%s' doesn't predict on new data and predictions may not make sense on new data", id)
  warning(warningCondition(msg, class = "predictionUselessWarning"))
}

allow_partial_matching = list(
  warnPartialMatchArgs = FALSE,
  warnPartialMatchAttr = FALSE,
  warnPartialMatchDollar = FALSE
)

check_centers_param = function(centers, task, test_class, name) {
  if (test_class(centers)) {
    if (ncol(centers) != task$ncol) {
      stop(sprintf("`%s` must have same number of columns as data.", name))
    }
  }
}

Try the mlr3cluster package in your browser

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

mlr3cluster documentation built on March 31, 2023, 11:11 p.m.