42 lines
1.1 KiB
R
42 lines
1.1 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/loadForest.R
|
|
\name{loadForest}
|
|
\alias{loadForest}
|
|
\title{Load Random Forest}
|
|
\usage{
|
|
loadForest(directory, forest.output = c("online", "offline"),
|
|
maxTreeNum = NULL)
|
|
}
|
|
\arguments{
|
|
\item{directory}{The directory created that saved the previous forest.}
|
|
|
|
\item{forest.output}{Specifies whether the forest loaded should be loaded
|
|
into memory, or reflect the saved files where only one tree is loaded at a
|
|
time.}
|
|
|
|
\item{maxTreeNum}{If for some reason you only want to load the number of
|
|
trees up until a certain point, you can specify maxTreeNum as a single
|
|
number.}
|
|
}
|
|
\value{
|
|
A JForest object; see \code{\link{train}} for details.
|
|
}
|
|
\description{
|
|
Loads a random forest that was saved using \code{\link{saveForest}}.
|
|
}
|
|
\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)
|
|
|
|
saveForest(forest, "trees")
|
|
new_forest <- loadForest("trees")
|
|
}
|
|
\seealso{
|
|
\code{\link{train}}, \code{\link{saveForest}}
|
|
}
|