Description Usage Arguments Value Examples
Given an autocart model object, predict for new data passed in
1 | predictAutocart(autocartModel, newdata)
|
autocartModel |
An S3 object of type "autocart" returned from the autocart function |
newdata |
A dataframe with the same amount of columns used to create the autocart model. |
A numeric vector containing the predicted response value for each of the rows in the passed in dataframe.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Load some data for an autocart predict 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 an autocart model with 50 trees
snow_model <- autocart(y, X, locations, 0.30, 0)
# Predict in autocart
new_X <- X[1:10, ]
new_loc <- locations[1:10, ]
autocart_predictions <- predictAutocart(snow_model, new_X)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.