autoforest {autocart}R Documentation

Create a forest of autocart trees..

Description

Create a forest of autocart trees..

Usage

autoforest(
  response,
  data,
  locations,
  alpha,
  beta,
  control,
  numtrees,
  mtry = NULL
)

Arguments

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 autocartControl function that will be used for each tree in the forest.

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.

Value

An object of type "autoforest", which is a list of the autocart trees.

Examples

# 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)


[Package autocart version 1.4.5 Index]