% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ETree.R
\name{ETree}
\alias{ETree}
\title{Main function of the package. It performs the Exact Tree method.}
\usage{
ETree(
  formula = NULL,
  data = NULL,
  map = NULL,
  original = NULL,
  round = NULL,
  discretize = NULL,
  selV = NULL,
  control = NULL,
  verbose = TRUE
)
}
\arguments{
\item{formula}{a description of the model to be fit. The format is \code{Y ~  X1 + \dots + Xn},
where the variable before ~ represents the dependent variable and the variables after
the ~ are the independent variables.}

\item{data}{Dataset to be analyzed. Note: If data contains ordinal variables, transform them to numerical
before using this function. Otherwise, they will be treated as nominal variables.}

\item{map}{[ori vars] sets for each variable whether the tree will depict
thresholds based upon original values (var number), or recoded values (0).}

\item{original}{[TRUE/FALSE] sets for each variable whether the tree will depict
thresholds based upon original values (true), or recoded values (false).}

\item{round}{[factors] autorecoding based upon rounded categories; the categories will
be round after multiplying with the factor, and devided by the
factor after rounding}

\item{discretize}{[ncat] optimal discretization while minimizing SS within
a group, indicate with a number how many categories;set ncat=0 for each variable that is to
be left unaltered}

\item{selV}{list containing the output obtained using \code{\link{SelectVar}}.
Use this list instead of the previous inputs if you want to perform SelectVars outside ETree.}

\item{control}{a list with control parameters as returned by \code{\link{ETree.control}}.}

\item{verbose}{logical, if TRUE, prints information about the progress of the algorithm.}
}
\value{
Returns the following 6 elements:
 \item{h}{contains the objective function value (fit) of the best tree.}
 \item{Tree}{contains the largest Tree table.}
 \item{hAll}{(OPTIONAL) contains the objective function values for all trees, if more than one is requested}
 \item{TAll}{(OPTIONAL) contains Tree tables for all trees, if more than one is requested.}
 \item{Transf_Trees}{contains an object of class ExactTree that can be used in \code{\link{plot.ETree}} and \code{\link{summary.ETree}}}
 \item{CVOutput}{Cross validation results for all the requested trees.}
}
\description{
Main function of the package. It performs the Exact Tree method.
}
\details{
The function results in a global tree (for given maxsize and maxdepth) and transforms the output to obtain summary information and plot the tree.
}
\examples{
\donttest{
  data(iris)
  # Fit an Exact Tree model
  controlEtree <- ETree.control(measure=0, maxsize = 4, maxdepth = 3,
  minbucket = 5, ncv=5, alltreesizes = FALSE)
  ETree(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width,
  control= controlEtree, data = iris)
}


}
\seealso{
\code{\link{summary.ETree}}, \code{\link{SelectVar}},
  \code{\link{plot.ETree}},\code{\link{ETree.control}},
  \code{\link{predict.ETree}},\code{\link{prune.ETree}}
}
\keyword{exact}
\keyword{tree}
