Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
^__pycache__/
^.cache/
^python-req\.txt$
examples.R
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 2.0.1
Date: 2025-12-02 22:24:02 UTC
SHA: 88496b0c320e65d5bc0ad8ab6e6cee661b3306ba
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: neuralGAM
Type: Package
Title: Interpretable Neural Network Based on Generalized Additive Models
Version: 2.0
Version: 2.0.1
Authors@R: c(person("Ines", "Ortega-Fernandez", role = c("aut", "cre", "cph"),
email = "iortega@gradiant.org",
comment = c(ORCID = "0000-0002-8041-6860")),
Expand All @@ -25,7 +25,7 @@ Imports:
patchwork,
rlang
SystemRequirements: python (>= 3.10), keras (== 2.15), tensorflow (== 2.15)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE)
Suggests:
covr,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ S3method(predict,neuralGAM)
S3method(print,neuralGAM)
S3method(summary,neuralGAM)
export(autoplot)
export(autoplot.neuralGAM)
export(diagnose)
export(install_neuralGAM)
export(neuralGAM)
export(plot_history)
export(predict.neuralGAM)
export(sim_neuralGAM_data)
import(patchwork)
importFrom(formula.tools,lhs)
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# neuralGAM 2.0
# neuralGAM 2.0.1

* Minor bug fix related to the exportation of S3 methods (autoplot, predict).
* Minor corrections in documentation

# neuralGAM 2.0.0

* **Major update** with expanded flexibility, improved diagnosis tools, and uncertainty quantification.
* **Additional distribution families**: now supports `poisson` in addition to `gaussian` and `binomial`.
Expand Down
10 changes: 4 additions & 6 deletions R/NeuralGAM.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' }
#' @param loss Loss function to use. Can be any Keras built-in (e.g., `"mse"`, `"mae"`,
#' `"huber"`, `"logcosh"`) or a custom function, passed directly to `keras::compile()`.
#' @param alpha Significance level for prediction intervals, e.g. \code{0.05} for 95% coverage.
#' @param alpha Significance level for confidence intervals, e.g. \code{0.05} for 95% coverage.
#' @param dropout_rate Dropout probability in smooth-term NNs (0,1).
#' \itemize{
#' \item During training: acts as a regularizer.
Expand Down Expand Up @@ -355,10 +355,7 @@ neuralGAM <-
f[formula$p_terms] <- predict(linear_model, type = "terms", verbose = verbose)
eta <- eta0 + rowSums(f)

# Do NOT create per-term PIs for parametric effects
# (prediction intervals are response-level; not meaningful per term)

# Instead, store epistemic variance for CI of the mean contribution
# Store epistemic variance for CI of the mean contribution
# using predict.lm(type="terms", se.fit=TRUE)
for (tm in formula$p_terms) {
pr_tm <- stats::predict(linear_model,
Expand Down Expand Up @@ -487,7 +484,7 @@ neuralGAM <-
alpha = alpha,
forward_passes = forward_passes)
if(build_pi == TRUE){
# Update prediction intervals
# Update CI
lwr[[term]] <- preds$lwr - term_center[[term]]
upr[[term]] <- preds$upr - term_center[[term]]
}
Expand Down Expand Up @@ -572,6 +569,7 @@ neuralGAM <-

.onLoad <- function(libname, pkgname) {
.disable_tf_logs_env_only()
requireNamespace("neuralGAM", quietly = TRUE)
}

.onAttach <- function(libname, pkgname) {
Expand Down
1 change: 1 addition & 0 deletions R/autoplot.neuralGAM.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ ggplot2::autoplot
#' @importFrom stats predict qnorm
#' @author Ines Ortega-Fernandez, Marta Sestelo
#' @method autoplot neuralGAM
#' @export autoplot.neuralGAM
#' @export
autoplot.neuralGAM <- function(object,
newdata = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.NeuralGAM.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @description
#' Visualization of a fitted \code{neuralGAM}. Plots learned partial effects, either as
#' scatter/line plots for continuous covariates or s for factor covariates.
#' Confidence and/or prediction intervals can be added if available.
#' Confidence intervals can be added if available.
#'
#' @param x A fitted \code{neuralGAM} object as produced by \code{neuralGAM()}.
#' @param select Character vector of terms to plot. If \code{NULL} (default),
Expand Down
1 change: 1 addition & 0 deletions R/predict.NeuralGAM.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#' }
#' @importFrom stats predict qnorm setNames
#' @method predict neuralGAM
#' @export predict.neuralGAM
#' @export
#' @author Ines Ortega-Fernandez, Marta Sestelo
predict.neuralGAM <- function(object,
Expand Down
31 changes: 31 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# neuralGAM 2.0.1

This version fixes a minor bug which caused S3 methods to don't be properly exported.

`predict.neuralGAM` and `autoplot.neuralGAM` are now properly exported, while keeping the S3 registrations.

## R CMD check results

── Local R CMD check results ──── neuralGAM 2.0.1 ────

❯ checking for future file timestamps ... NOTE
unable to verify current time

0 errors ✔ | 0 warnings ✔ | 1 notes ✖

── devtools::check_win_devel() ──── neuralGAM 2.0.1 ────

> Installation time in seconds: 52
> Check time in seconds: 493
> Status: OK
> R Under development (unstable) (2025-12-01 r89083 ucrt)

── devtools::check_mac_release() ──── neuralGAM 2.0.1 ────

> OK

* Local: `R CMD check` passed on Windows 11 (x86_64, mingw32, R 4.4.1 2024-06-14 ucrt).
* NOTE related to unability of R to verify current time, which is a known issue reported [here](https://forum.posit.co/t/r-devel-r-cmd-check-failing-because-of-time-unable-to-verify-current-time/25589):
* GitHub Actions: [R-CMD-check](https://github.com/inesortega/neuralGAM/actions/workflows/R-CMD-check.yaml) passes on macOS, Windows, and Ubuntu (R-release, R-devel, R-oldrel).
* Coverage: >75% test coverage confirmed with [codecov](https://app.codecov.io/gh/inesortega/neuralGAM).

# neuralGAM 2.0.0

This version introduces major new functionality and internal improvements:
Expand Down
Loading
Loading