| Title: | Design-Based Residual-Correction Forests for Digital Soil Mapping |
|---|---|
| Description: | Implements DB-TARF (Design-Based Targeted Adaptive Residual Forest) for large-scale digital soil and ecological mapping evaluated under the design-based paradigm of Wadoux et al. (2021) <doi:10.1016/j.ecolmodel.2021.109692>. A random forest is augmented by a cross-fitted, out-of-fold-selected residual correction (residual forests, ordinary kriging, recalibration), together with design-based conformal prediction intervals. |
| Authors: | Hugo Rodrigues [aut, cre] |
| Maintainer: | Hugo Rodrigues <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-07-07 08:22:17 UTC |
| Source: | https://github.com/hugomachadorodrigues/geoversa |
DB-TARF (Design-Based Targeted Adaptive Residual Forest) fits a random-forest
base learner on train_df and adds a cross-fitted, out-of-fold-selected
residual correction, then predicts test_df. A correction is adopted
only when it lowers the out-of-fold RMSE of the calibration sample.
dbtarf_train_predict( train_df, test_df, response_name, predictor_names = NULL, coord_names = "auto", ... )dbtarf_train_predict( train_df, test_df, response_name, predictor_names = NULL, coord_names = "auto", ... )
train_df |
A data frame with the response, predictors and (optionally) coordinate columns. |
test_df |
A data frame with the same predictor (and coordinate) columns
as |
response_name |
Character; name of the response column in |
predictor_names |
Character vector of predictor column names, or
|
coord_names |
Length-2 character vector of coordinate column names, or
|
... |
Further arguments passed to the internal training routine (e.g.
|
A list with the test predictions (pred_test), the base-RF
predictions (pred_test_base), conformal prediction-interval
half-widths (pi_q90, pi_q95), per-run diagnostics and
the candidate_table. When ensemble_top_k > 1 the
diagnostics additionally record ensemble_applied,
ensemble_size, ensemble_weighting, ensemble_temperature,
ensemble_profiles, ensemble_profile_oof_rmse and
ensemble_weights, and candidate_table gains
ensemble_member, ensemble_rank and ensemble_weight
columns. Note that when the ensemble is applied the conformal half-widths
(pi_q90, pi_q95 and the _w/_sp variants) are
inherited from the single best (top-ranked OOF) profile and are not
recalibrated against the blended pred_test; the conformal coverage
guarantee therefore pertains to the best single profile, not to the blended
point estimate (diagnostics$ensemble_pi_from_best flags this).
set.seed(1) n <- 120 tr <- data.frame(y = rnorm(n), a = rnorm(n), b = rnorm(n)) te <- tr[1:15, ] out <- dbtarf_train_predict(tr, te, "y", c("a", "b"), coord_names = NULL, rf_tune = FALSE, fair_profile_search = FALSE) head(out$pred_test)set.seed(1) n <- 120 tr <- data.frame(y = rnorm(n), a = rnorm(n), b = rnorm(n)) te <- tr[1:15, ] out <- dbtarf_train_predict(tr, te, "y", c("a", "b"), coord_names = NULL, rf_tune = FALSE, fair_profile_search = FALSE) head(out$pred_test)