Description Usage Arguments Value Examples
Create a forest of autocart trees..
1 2 3 4 5 6 7 8 9 10 | autoforest(
response,
data,
locations,
alpha,
beta,
control,
numtrees,
mtry = NULL
)
|
response |
The response vector that goes along with the dataframe of predictors. |
data |
The dataframe of predictors. |
locations |
A matrix of the locations of the dataframe of predictors. |
alpha |
The percentage of weighting on spatial autocorrelation in the splitting function. |
beta |
The percentage of weighting on spatial compactness in the splitting function. |
control |
A control object from the |
numtrees |
The number of autocart trees to create in the forest. |
mtry |
The number of variables to subset at each node of the splitting in the trees. By default, this will be 1/3 of the features. |
An object of type "autoforest", which is a list of the autocart trees.
1 2 3 4 5 6 7 8 9 10 11 | # Load some data for an autoforest example
snow <- na.omit(read.csv(system.file("extdata", "ut2017_snow.csv", package = "autocart")))
y <- snow$yr50[1:40]
X <- data.frame(snow$ELEVATION, snow$MCMT, snow$PPTWT, snow$HUC)[1:40, ]
locations <- as.matrix(cbind(snow$LONGITUDE, snow$LATITUDE))[1:40, ]
# Create a control object for the autoforest tree
snow_control <- autocartControl(spatialBandwidthProportion = 1.0)
# Create an autoforest model with 5 trees
snow_model <- autoforest(y, X, locations, 0.30, 0, snow_control, numtrees = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.