Skip to content

Sparse Additive Modelling

4packages depend
6Kdownloads / year
72.1%test coverage
13/13flavors OK

Overview

About
Maintained by Tuo ZhaoCRAN page ↗

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.

Changes in 1.3

Bug Fixes

  • Fixed KKT validation: inactive groups are now checked after every Level 1 iteration, not only when not converged.
  • Fixed grpSVM ya_idx active-set logic that only checked the first element of each group instead of all p coefficients.
  • Replaced assert() with runtime error checks in grplasso, grpLR, and grpPR (asserts are compiled out under -DNDEBUG).
  • Added NULL checks for all malloc calls in grpSVM.

New Features

  • dfmax parameter for early stopping when the number of non-zero groups exceeds a threshold (all four families).
  • verbose parameter 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 by family argument (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.gaussian option for samQL ("naive" / "covariance" / "auto").
  • runtime field on fitted objects (R: $runtime, Python: .runtime_seconds).

Python Wrapper

  • New pysam-sam Python package calling the same C++ core via ctypes.
  • Pure-Python spline basis (no R dependency at runtime).
  • Full API parity: samLL, samHL, samEL, samQL + predict functions.

Performance

  • Cached wXX products and no-op update_auxiliary for linear objective.
  • C API deduplication via c_api_utils.h.

Code Quality

  • Removed redundant fit$nkots field from R wrappers.
  • Removed unused fit$XX (full design matrix) from samQL output.
  • Removed unused V(d) declarations in grpLR and grpPR.
  • Extracted shared .sam_print_path() / .sam_plot_path() helpers.
  • Removed unused scipy dependency from Python package.
  • Fixed legacy PICASSO_SOLVER_PARAMS_H header guard.
  • Added root .gitignore.
  • Added test coverage for samHL and samEL.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.7 min · r-devel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 1.3
READMEYes · 86 wordsVignettesNoNEWSYes · 100% structured · mentions 1.3Citation fileNoWebsitenot declared in DESCRIPTION
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

6K
CRAN downloads in the past year
Rank #6,889 · ~16/day · ~500/mo
Daily download trend is not available in this view yet.
47130 days
1.2K90 days
6K1 year
Compare downloads with other packages →
Also on415 r2u8 autocran93 c2d4u

Dependencies

Declared dependencies
2 external dependencies (excludes base and recommended)

Installing SAM adds 2 packages (2 with compiled code, 3.5 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppEigen 1.7 MB.

Depends (2)
R >= 2.14splines
Imports (0)
none
LinkingTo (2)
Suggests (0)
none
Enhances (0)
none
Reverse dependencies
4direct
0indirect
Imports 4
Depends, Imports or LinkingTo, most downloaded first

People & History

People (6)
Author, Maintainer since 1.2 (2026)
Author · added in 1.1.0
Author
Author · added in 1.1.0

Previously maintained by Haoming Jiang (1.1.0 to 1.1.3) and Tuo Zhao (1.0.2 to 1.0.5).

Listed in earlier versions (2)
no longer listed · 1.0.2
no longer listed · 1.1.0 to 1.1.1
Releases (11)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.3Latest
    record
    2026-03-13 · current release · diff ↗ ·
    added 1 export
    sam
  • 1.2
    record
    2026-02-19 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • unarchivedReturned to CRAN
    2021-07-01
  • 1.1.3
    record
    2021-07-01 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • orphanedOrphaned by its maintainer
    2019-07-02
    misuse of package= for PACKAGE= was not corrected despite reminder
  • 1.1.2.1
    record
    2019-07-02 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 1.1.2
    record
    2019-04-07 · diff ↗
  • 1.1.1
    record
    2019-03-12 · diff ↗
Show 12 earlier eventsHide 12 earlier events
  • 1.1.0
    record
    2019-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
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • 1.0.5
    record
    2014-02-12 · diff ↗
  • 1.0.4
    record
    2013-09-18 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • 1.0.3
    record
    2013-04-02 · diff ↗ ·
    removed 9 exports
    spam, l1svm, fastscr, print.spam, plot.spam, predict.spam, print.l1svm, plot.l1svm, predict.l1svm
    added 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.2
    record
    2012-10-15
  • R
    R 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")
Zhao, T., Jiang, H., Li, X., Liu, H., Ma, Y., & Roeder, K. (2026). SAM: Sparse Additive Modelling (Version 1.3) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for SAM version 1.3 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy