Sparse Additive Modelling
Overview
Computationally efficient tools for high dimensional predictive modeling (regression and classification). SAM is short for sparse additive modeling, and adopts the computationally efficient basis spline technique. We solve the optimization problems by various computational algorithms including the block coordinate descent algorithm, fast iterative soft-thresholding algorithm, and newton method. The computation is further accelerated by warm-start and active-set tricks.
Bug Fixes
- Fixed KKT validation: inactive groups are now checked after every Level 1 iteration, not only when not converged.
- Fixed
grpSVMya_idxactive-set logic that only checked the first element of each group instead of allpcoefficients. - Replaced
assert()with runtime error checks ingrplasso,grpLR, andgrpPR(asserts are compiled out under-DNDEBUG). - Added NULL checks for all
malloccalls ingrpSVM.
New Features
dfmaxparameter for early stopping when the number of non-zero groups exceeds a threshold (all four families).verboseparameter to print per-lambda iteration info.
Show all changes in 1.3Hide the rest of the changes in 1.3
- Deviance-ratio and deviance-change early stopping (
dev.ratio.thr,dev.change.thr) for samQL, samLL, and samEL. - Unified
sam()entry point dispatching byfamilyargument (R and Python). coef()S3 methods for all four model classes.solver = "actgd"option for samQL (group active gradient descent with strong-rule screening, L1 only).type.gaussianoption for samQL ("naive"/"covariance"/"auto").runtimefield on fitted objects (R:$runtime, Python:.runtime_seconds).
Python Wrapper
- New
pysam-samPython package calling the same C++ core viactypes. - Pure-Python spline basis (no R dependency at runtime).
- Full API parity:
samLL,samHL,samEL,samQL+ predict functions.
Performance
- Cached
wXXproducts and no-opupdate_auxiliaryfor linear objective. - C API deduplication via
c_api_utils.h.
Code Quality
- Removed redundant
fit$nkotsfield from R wrappers. - Removed unused
fit$XX(full design matrix) from samQL output. - Removed unused
V(d)declarations ingrpLRandgrpPR. - Extracted shared
.sam_print_path()/.sam_plot_path()helpers. - Removed unused
scipydependency from Python package. - Fixed legacy
PICASSO_SOLVER_PARAMS_Hheader guard. - Added root
.gitignore. - Added test coverage for samHL and samEL.
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 18includes a package overview page
- Examples that run
- 100%5 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 6%
Downloads
Dependencies
Installing SAM adds 2 packages (2 with compiled code, 3.5 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppEigen 1.7 MB.
Code & Tests
People & History
Previously maintained by Haoming Jiang (1.1.0 to 1.1.3) and Tuo Zhao (1.0.2 to 1.0.5).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.3Latest
- 1.22026-02-19 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- unarchivedReturned to CRAN2021-07-01
- 1.1.32021-07-01 · diff ↗
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- orphanedOrphaned by its maintainer2019-07-02misuse of package= for PACKAGE= was not corrected despite reminder
- 1.1.2.12019-07-02 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.1.22019-04-07 · diff ↗
- 1.1.12019-03-12 · diff ↗
Show 12 earlier eventsHide 12 earlier events
- 1.1.02019-02-18 · diff ↗ ·
removed 12 exports
print.samQL, plot.samQL, predict.samQL, print.samHL, plot.samHL, predict.samHL, print.samLL, plot.samLL, predict.samLL, print.samEL, plot.samEL, predict.samEL - RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 1.0.52014-02-12 · diff ↗
- 1.0.42013-09-18 · diff ↗
- RR 3.0.0 released · 2013-04-03
- 1.0.32013-04-02 · diff ↗ ·
removed 9 exports
spam, l1svm, fastscr, print.spam, plot.spam, predict.spam, print.l1svm, plot.l1svm, predict.l1svmadded 16 exports
samQL, print.samQL, plot.samQL, predict.samQL, samHL, print.samHL, plot.samHL, predict.samHL, samLL, print.samLL, plot.samLL, predict.samLL, samEL, print.samEL, plot.samEL, predict.samEL - 1.0.22012-10-15
- RR 2.15.0 released · 2012-03-30
Package metadata
- First published
- 2012-10-15
- Total releases
- 11 / 14 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 2.14
- Download size
- 56 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("SAM")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.