2019-05-31 22:13:24 +00:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
2019-06-06 22:53:25 +00:00
|
|
|
% Please edit documentation in R/loadForest.R
|
|
|
|
\name{loadForest}
|
|
|
|
\alias{loadForest}
|
2019-05-31 22:13:24 +00:00
|
|
|
\title{Load Random Forest}
|
|
|
|
\usage{
|
2019-06-06 22:53:25 +00:00
|
|
|
loadForest(directory)
|
2019-05-31 22:13:24 +00:00
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{forest}{The directory created that saved the previous forest.}
|
|
|
|
}
|
|
|
|
\value{
|
|
|
|
A JForest object; see \code{\link{train}} for details.
|
|
|
|
}
|
|
|
|
\description{
|
2019-06-06 22:53:25 +00:00
|
|
|
Loads a random forest that was saved using \code{\link{saveForest}}.
|
2019-05-31 22:13:24 +00:00
|
|
|
}
|
|
|
|
\examples{
|
|
|
|
# Regression Example
|
|
|
|
x1 <- rnorm(1000)
|
|
|
|
x2 <- rnorm(1000)
|
|
|
|
y <- 1 + x1 + x2 + rnorm(1000)
|
|
|
|
|
|
|
|
data <- data.frame(x1, x2, y)
|
|
|
|
forest <- train(y ~ x1 + x2, data,
|
|
|
|
ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5)
|
|
|
|
|
2019-06-06 22:53:25 +00:00
|
|
|
saveForest(forest, "trees")
|
|
|
|
new_forest <- loadForest("trees")
|
2019-05-31 22:13:24 +00:00
|
|
|
}
|
|
|
|
\seealso{
|
2019-06-06 22:53:25 +00:00
|
|
|
\code{\link{train}}, \code{\link{saveForest}}, \code{\link{loadForestArg}}
|
2019-05-31 22:13:24 +00:00
|
|
|
}
|