-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathctree_train.Rd
84 lines (73 loc) · 2.77 KB
/
ctree_train.Rd
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/partykit.R
\name{ctree_train}
\alias{ctree_train}
\alias{cforest_train}
\title{A wrapper function for conditional inference tree models}
\usage{
ctree_train(
formula,
data,
weights = NULL,
minsplit = 20L,
maxdepth = Inf,
teststat = "quadratic",
testtype = "Bonferroni",
mincriterion = 0.95,
...
)
cforest_train(
formula,
data,
weights = NULL,
minsplit = 20L,
maxdepth = Inf,
teststat = "quadratic",
testtype = "Univariate",
mincriterion = 0,
mtry = ceiling(sqrt(ncol(data) - 1)),
ntree = 500L,
...
)
}
\arguments{
\item{formula}{A symbolic description of the model to be fit.}
\item{data}{A data frame containing the variables in the model.}
\item{weights}{A vector of weights whose length is the same as \code{nrow(data)}.
For \code{\link[partykit:ctree]{partykit::ctree()}} models, these are required to be non-negative
integers while for \code{\link[partykit:cforest]{partykit::cforest()}} they can be non-negative integers
or doubles.}
\item{minsplit}{The minimum sum of weights in a node in order to be
considered for splitting.}
\item{maxdepth}{maximum depth of the tree. The default \code{maxdepth = Inf}
means that no restrictions are applied to tree sizes.}
\item{teststat}{A character specifying the type of the test statistic to be
applied.}
\item{testtype}{A character specifying how to compute the distribution of
the test statistic.}
\item{mincriterion}{The value of the test statistic (for \code{testtype ==
"Teststatistic"}), or 1 - p-value (for other values of \code{testtype}) that
must be exceeded in order to implement a split.}
\item{...}{Other options to pass to \code{\link[partykit:ctree]{partykit::ctree()}} or \code{\link[partykit:cforest]{partykit::cforest()}}.}
\item{mtry}{Number of input variables randomly sampled as candidates at each
node for random forest like algorithms. The default \code{mtry = Inf} means
that no random selection takes place.}
\item{ntree}{Number of trees to grow in a forest.}
}
\value{
An object of class \code{party} (for \code{ctree}) or \code{cforest}.
}
\description{
These functions are slightly different APIs for \code{\link[partykit:ctree]{partykit::ctree()}} and
\code{\link[partykit:cforest]{partykit::cforest()}} that have several important arguments as top-level
arguments (as opposed to being specified in \code{\link[partykit:ctree_control]{partykit::ctree_control()}}).
}
\examples{
\dontshow{if (!parsnip:::is_cran_check()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
if (rlang::is_installed(c("modeldata", "partykit"))) {
data(bivariate, package = "modeldata")
ctree_train(Class ~ ., data = bivariate_train)
ctree_train(Class ~ ., data = bivariate_train, maxdepth = 1)
}
\dontshow{\}) # examplesIf}
}