File: tuneGrid.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 (11 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
# tunes with grid search, all params are supported as we use generateGridDesign
tuneGrid = function(learner, task, resampling, measures, par.set, control, opt.path, show.info, resample.fun) {
  des = generateGridDesign(par.set, resolution = control$extra.args$resolution, trafo = FALSE)
  if (!is.null(control$budget) && (nrow(des) != control$budget)) {
    stopf("The given budget (%i) does not fit to the size of the grid (%i).", control$budget, nrow(des))
  }
  xs = dfRowsToList(des, par.set)
  evalOptimizationStatesTune(learner, task, resampling, measures, par.set, control, opt.path,
    show.info, xs, dobs = seq_along(xs), eols = NA_integer_, remove.nas = TRUE, resample.fun = resample.fun)
  makeTuneResultFromOptPath(learner, par.set, measures, resampling, control, opt.path)
}