R/getClassWeightParam.R

#' @title Get the class weight parameter of a learner.
#'
#' @description
#' Gets the class weight parameter of a learner.
#'
#' @template arg_learner
#' @return [\code{numeric \link{LearnerParam}}]:
#'   A numeric parameter object, containing the class weight parameter of the given learner.
#' @family learner
#' @export
getClassWeightParam = function(learner) {
  learner = checkLearner(learner, "classif")
  assertChoice("class.weights", getLearnerProperties(learner))
  learner$par.set$pars[[learner$class.weights.param]]
}
Najah-lshanableh/R-data-mining2 documentation built on May 6, 2019, 10:11 a.m.