if (FALSE) {
library(neuralGAM)
dat <- sim_neuralGAM_data()
train <- dat$train
test <- dat$test
ngam <- neuralGAM(
y ~ s(x1) + x2 + s(x3),
data = train, family = "gaussian", num_units = 128,
uncertainty_method = "epistemic", forward_passes = 10
)
## --- Autoplot (epistemic-only) ---
# Per-term effect with CI band
autoplot(ngam, which = "terms", term = "x1", interval = "confidence") +
ggplot2::xlab("x1") + ggplot2::ylab("Partial effect")
# Request a different number of forward passes or CI level:
autoplot(ngam, which = "terms", term = "x1", interval = "confidence",
forward_passes = 15, level = 0.7)
# Response panel
autoplot(ngam, which = "response")
# Link panel with custom title
autoplot(ngam, which = "link") +
ggplot2::ggtitle("Main Title")
}
Run the code above in your browser using DataLab