View source: R/get_predictions.R
| get_predictions | R Documentation |
Extracts fitted (in-sample) predictions from models fitted with rf(), rf_repeat(), or rf_spatial().
get_predictions(model)
model |
Model object from |
This function returns fitted predictions for the training data used to build the model, not predictions for new data. For out-of-sample predictions on new data use stats::predict().
Numeric vector of fitted predictions with length equal to the number of training observations. For rf_repeat() models, returns the median prediction across repetitions.
rf(), rf_repeat(), rf_spatial(), get_residuals()
Other model_info:
get_evaluation(),
get_importance(),
get_importance_local(),
get_moran(),
get_performance(),
get_residuals(),
get_response_curves(),
get_spatial_predictors(),
print.rf(),
print_evaluation(),
print_importance(),
print_moran(),
print_performance()
data(plants_rf)
# Extract fitted predictions
predictions <- get_predictions(plants_rf)
head(predictions)
# Check length matches number of observations
length(predictions)
# Compare with observed values to assess fit
# (observed values would be in original data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.