model_evaluation_examples: Examples for model evaluation functions

model_evaluation_examplesR Documentation

Examples for model evaluation functions

Description

Examples for model evaluation functions

Examples


library(randomForest)
library(caret)
data(panc_incidence)
mapdata <- join_data(africa_shp, panc_incidence, by = "NAME")
rf_model <- randomForest(incidence ~ female + male + agea + ageb + agec + fagea + fageb + fagec +
magea + mageb + magec + yrb + yrc + yrd + yre, data = mapdata, ntree = 500,
importance = TRUE)

rf_preds <- predict(rf_model, newdata = mapdata)
rf_metrics <- postResample(pred = rf_preds, obs = mapdata$incidence)
print(rf_metrics)


mlspatial documentation built on Aug. 27, 2025, 1:09 a.m.