get_predictions {spatialRF} | R Documentation |
Gets model predictions
Description
Returns model predictions from a model fitted with rf()
, rf_repeat()
, or rf_spatial()
.
Usage
get_predictions(model)
Arguments
model |
A model produced by |
Value
A vector with predictions, or median of the predictions across repetitions if the model was fitted with rf_repeat()
.
Examples
if(interactive()){
#loading example data
data(plant_richness_df)
#fitting a random forest model
rf.model <- rf(
data = plant_richness_df,
dependent.variable.name = "richness_species_vascular",
predictor.variable.names = colnames(plant_richness_df)[5:21],
n.cores = 1,
verbose = FALSE
)
#get vector of predictions
x <- get_predictions(rf.model)
x
}
[Package spatialRF version 1.1.4 Index]