| predict_swrc_dense | R Documentation |
For each unique (PEDON_ID × depth) profile in newdata, predicts theta
across a dense grid of pF values and returns a tidy long-format tibble.
predict_swrc_dense(
object,
newdata,
n_points = 1000L,
pf_range = NULL,
id_cols = c("PEDON_ID", "Depth_num", "Depth_label", "Texture")
)
object |
A |
newdata |
A data frame with covariate columns plus (optionally)
|
n_points |
Number of equally spaced pF points (default |
pf_range |
Numeric vector of length 2: min and max pF values for
the output grid. The default |
id_cols |
Character vector of columns used to identify profiles
(default |
A tibble with columns: all id_cols present in newdata,
pF, matric_head, and theta (predicted volumetric water content
in m3/m3).
if (reticulate::py_module_available("tensorflow")) {
# A deliberately small, fast fit: 20 pedons, K = 16 and 50 collocation
# points per residual set. The point here is the interface, not the
# model -- see the vignette for a realistic configuration.
d <- prepare_swrc_data(swrc_example, depth_col = "depth")
d <- d[d$PEDON_ID %in% utils::head(unique(d$PEDON_ID), 20L), ]
x <- c("clay", "silt", "bd_gcm3", "soc", "Depth_num")
SM <- list(K = 16L, S1 = 50L, S2 = 50L, S3 = 50L, S4 = 50L,
epochs = 2L, verbose = FALSE)
fit <- do.call(fit_swrc, c(list(train_df = d, x_inputs = x), SM))
dense <- predict_swrc_dense(fit, newdata = d, n_points = 50)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.