Set the hyperparameters of a learner object.
setHyperPars(learner, ..., par.vals = list())
(Learner | character(1)
)
The learner.
If you pass a string the learner will be created via makeLearner.
(any)
Named (hyper)parameters with new setting. Alternatively these can be passed
using the par.vals
argument.
(list)
Optional list of named (hyper)parameter settings. The arguments in
...
take precedence over values in this list.
Other learner: LearnerProperties
,
getClassWeightParam
,
getHyperPars
, getLearnerId
,
getLearnerPackages
,
getLearnerParVals
,
getLearnerParamSet
,
getLearnerPredictType
,
getLearnerShortName
,
getLearnerType
, getParamSet
,
helpLearnerParam
,
helpLearner
, makeLearners
,
makeLearner
, removeHyperPars
,
setId
, setLearnerId
,
setPredictThreshold
,
setPredictType
# NOT RUN {
cl1 = makeLearner("classif.ksvm", sigma = 1)
cl2 = setHyperPars(cl1, sigma = 10, par.vals = list(C = 2))
print(cl1)
# note the now set and altered hyperparameters:
print(cl2)
# }
Run the code above in your browser using DataLab