View source: R/getResamplingIndices.R
getResamplingIndices | R Documentation |
After you resampled a tuning or feature selection wrapper (see makeTuneWrapper)
with resample(..., extract = getTuneResult)
or resample(..., extract = getFeatSelResult)
this helper returns a list
with
the resampling indices used for the respective method.
getResamplingIndices(object, inner = FALSE)
object |
(ResampleResult) |
inner |
(logical) |
(list). One list for each outer resampling fold.
Other tune:
TuneControl
,
getNestedTuneResultsOptPathDf()
,
getNestedTuneResultsX()
,
getTuneResult()
,
makeModelMultiplexerParamSet()
,
makeModelMultiplexer()
,
makeTuneControlCMAES()
,
makeTuneControlDesign()
,
makeTuneControlGenSA()
,
makeTuneControlGrid()
,
makeTuneControlIrace()
,
makeTuneControlMBO()
,
makeTuneControlRandom()
,
makeTuneWrapper()
,
tuneParams()
,
tuneThreshold()
task = makeClassifTask(data = iris, target = "Species")
lrn = makeLearner("classif.rpart")
# stupid mini grid
ps = makeParamSet(
makeDiscreteParam("cp", values = c(0.05, 0.1)),
makeDiscreteParam("minsplit", values = c(10, 20))
)
ctrl = makeTuneControlGrid()
inner = makeResampleDesc("Holdout")
outer = makeResampleDesc("CV", iters = 2)
lrn = makeTuneWrapper(lrn, resampling = inner, par.set = ps, control = ctrl)
# nested resampling for evaluation
# we also extract tuned hyper pars in each iteration and by that the resampling indices
r = resample(lrn, task, outer, extract = getTuneResult)
# get tuning indices
getResamplingIndices(r, inner = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.