34 lines
772 B
Text
34 lines
772 B
Text
|
% Generated by roxygen2: do not edit by hand
|
||
|
% Please edit documentation in R/load_forest.R
|
||
|
\name{load_forest}
|
||
|
\alias{load_forest}
|
||
|
\title{Load Random Forest}
|
||
|
\usage{
|
||
|
load_forest(directory)
|
||
|
}
|
||
|
\arguments{
|
||
|
\item{forest}{The directory created that saved the previous forest.}
|
||
|
}
|
||
|
\value{
|
||
|
A JForest object; see \code{\link{train}} for details.
|
||
|
}
|
||
|
\description{
|
||
|
Loads a random forest that was saved using \code{\link{save_forest}}.
|
||
|
}
|
||
|
\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)
|
||
|
|
||
|
save_forest(forest, "trees")
|
||
|
new_forest <- load_forest("trees")
|
||
|
}
|
||
|
\seealso{
|
||
|
\code{\link{train}}, \code{\link{save_forest}}
|
||
|
}
|