File: getClassWeightParam.R

package info (click to toggle)
r-cran-mlr 2.13-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,760 kB
  • sloc: ansic: 65; sh: 13; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#' @title Get the class weight parameter of a learner.
#'
#' @description
#' Gets the class weight parameter of a learner.
#'
#' @template arg_learner
#' @return [numeric] [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]]
}