File: tuner.Rd

package info (click to toggle)
r-cran-stablelearner 0.1-5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: makefile: 2
file content (61 lines) | stat: -rw-r--r-- 1,782 bytes parent folder | download | duplicates (2)
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
\name{tuner}
\alias{tuner}

\title{Tuning Wrapper Function}

\description{
  Convenience function to train a method using different tuning parameters.
}

\usage{
  tuner(method, tunerange, \ldots)
}

\arguments{
  \item{method}{a character string. Name of the \R function to train the method.}
  \item{tunerange}{a list. A list that specifies the range of values to be used
	for each tuning parameter. Each element of the list should be a vector 
	that specifies the values to be tested for the tuning parameter. The 
	element must be named after the corresponding tuning parameter of the 
	method (see examples).}
  \item{\ldots}{additional information passed to \code{method} (such as
	\code{formula}, \code{data}, \code{subset}, etc.).}
}

\details{
  This function can be used to train any method using different values for its
  tuning parameter(s). The result can be passed directly to \code{\link{stability}}
  to compare the stability of results based on different values of the tuning 
  parameter.
}

\value{
  A list that contains all fitted model objects.

  Additional information about the range of values used for the tuning parameters
  is attached to the resulting object as an attribute.
}

\seealso{\code{\link{stability}}}

\examples{

\donttest{

library("partykit")

## tuning cforest using different values of its tuning parameter mtry
r <- tuner("cforest", tunerange = list(mtry = 1:4), formula = Species ~ ., data = iris)

## assess stability (with B = 10 for illustration to avoid excessive computation times)
stability(r, control = stab_control(seed = 1234, B = 10))

## receive information about the range of tuning parameters
attr(r, "range")

}

}

\keyword{resampling}
\keyword{similarity}