Retrieves the current hyperparameter settings of a learner.
Usage
getHyperPars(learner, for.fun = c("train", "predict", "both"))
Arguments
- learner
(Learner)
The learner.- for.fun
(
character(1)
)
Restrict the returned settings to hyperparameters corresponding towhen
the are used (see ParamHelpers::LearnerParam). Must be a subset of: “train”, “predict” or “both”. Default isc("train", "predict", "both")
.
Value
(list). A named list of values.
Details
This function only shows hyperparameters that differ from the
learner default (because mlr
changed the default) or if the user set
hyperparameters manually during learner creation. If you want to have an
overview of all available hyperparameters use getParamSet()
.
See also
Other learner:
LearnerProperties
,
getClassWeightParam()
,
getLearnerId()
,
getLearnerNote()
,
getLearnerPackages()
,
getLearnerParVals()
,
getLearnerParamSet()
,
getLearnerPredictType()
,
getLearnerShortName()
,
getLearnerType()
,
getParamSet()
,
helpLearnerParam()
,
helpLearner()
,
makeLearners()
,
makeLearner()
,
removeHyperPars()
,
setHyperPars()
,
setId()
,
setLearnerId()
,
setPredictThreshold()
,
setPredictType()
Examples
getHyperPars(makeLearner("classif.ranger"))
#> $num.threads
#> [1] 1
#>
#> $verbose
#> [1] FALSE
#>
#> $respect.unordered.factors
#> [1] "order"
#>
## set learner hyperparameter `mtry` manually
getHyperPars(makeLearner("classif.ranger", mtry = 100))
#> $num.threads
#> [1] 1
#>
#> $verbose
#> [1] FALSE
#>
#> $respect.unordered.factors
#> [1] "order"
#>
#> $mtry
#> [1] 100
#>