File: getTuneThresholdExtra.R

package info (click to toggle)
r-cran-mlr 2.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,264 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (13 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
# in case we have tune.threshold activated we want this as an extra. otherwise NULL
# @arg control
#   control [TuneControl]
#   res [result from evalOptimizationState]
getTuneThresholdExtra = function(control, res) {
  if (control$tune.threshold) {
    # add class names to threshold, if longer than 1
    extra = as.list(res$threshold)
    setNames(extra, stri_paste("threshold", ifelse(length(extra) > 1L, ".", ""), names(extra), ignore_null = TRUE))
  } else {
    NULL
  }
}