File: setHyperPars.Rd

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 (67 lines) | stat: -rw-r--r-- 2,201 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setHyperPars.R
\name{setHyperPars}
\alias{setHyperPars}
\title{Set the hyperparameters of a learner object.}
\usage{
setHyperPars(learner, ..., par.vals = list())
}
\arguments{
\item{learner}{(\link{Learner} | \code{character(1)})\cr
The learner.
If you pass a string the learner will be created via \link{makeLearner}.}

\item{...}{(any)\cr Optional named (hyper)parameters. If you want to set
specific hyperparameters for a learner during model creation, these should
go here. You can get a list of available hyperparameters using
\verb{getParamSet(<learner>)}. Alternatively hyperparameters can be given using
the \code{par.vals} argument but \code{...} should be preferred!}

\item{par.vals}{(\link{list})\cr Optional list of named (hyper)parameters. The
arguments in \code{...} take precedence over values in this list. We strongly
encourage you to use \code{...} for passing hyperparameters.}
}
\value{
\link{Learner}.
}
\description{
Set the hyperparameters of a learner object.
}
\note{
If a named (hyper)parameter can't be found for the given learner, the 3
closest (hyper)parameter names will be output in case the user mistyped.
}
\examples{
\dontshow{ if (requireNamespace("kernlab")) \{ }
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)
\dontshow{ \} }
}
\seealso{
Other learner: 
\code{\link{LearnerProperties}},
\code{\link{getClassWeightParam}()},
\code{\link{getHyperPars}()},
\code{\link{getLearnerId}()},
\code{\link{getLearnerNote}()},
\code{\link{getLearnerPackages}()},
\code{\link{getLearnerParVals}()},
\code{\link{getLearnerParamSet}()},
\code{\link{getLearnerPredictType}()},
\code{\link{getLearnerShortName}()},
\code{\link{getLearnerType}()},
\code{\link{getParamSet}()},
\code{\link{helpLearner}()},
\code{\link{helpLearnerParam}()},
\code{\link{makeLearner}()},
\code{\link{makeLearners}()},
\code{\link{removeHyperPars}()},
\code{\link{setId}()},
\code{\link{setLearnerId}()},
\code{\link{setPredictThreshold}()},
\code{\link{setPredictType}()}
}
\concept{learner}