Skip to content

docs: varPro on small or sparse data vignette - #351

Merged
ehrlinger merged 3 commits into
mainfrom
docs/varpro-small-data
Oct 15, 2026
Merged

ehrlinger merged 3 commits into
mainfrom
docs/varpro-small-data

Conversation

@ehrlinger

Copy link
Copy Markdown
Owner

Adds the vignette "varPro on small or sparse data" (linked from varpro.qmd), carrying the findings of the AVSD virtual-twins varPro screen into the package docs. Follows #340, #341 and #350.

What it covers (PBC plus 10 permuted noise columns)

  • What z is: a winsorised mean of per-tree importance (trim = 0.1 clamps, it does not drop); an untested tree contributes 0, so a term tested in fewer than about 10% of trees gets z = 0. Zero means untested, not unimportant.
  • Coverage with varpro_coverage(), and how the defaults (max.tree, max.rules.tree, guided split weights, nvar) limit it on small data.
  • A noise-calibrated cutoff by variable kind, using tested noise only.
  • Cutoff sensitivity: the selected set moves a lot between 0.5 and 1.0; trim sensitivity is small.
  • Screen, not selection: what a single run can and cannot claim.
  • Factor partials: correct directions after fix: label gg_partial_varpro() categorical partials by $xvirtual #350 (stage 4 0.893 to 0.848; severe edema 0.893 to 0.682; KM 0.54 against 0.87). Notes that releases up to 4.0.0-rc9 could swap level labels. The varPro sibling one-hot caveat is measured (0.717 against 0.714 for a valid profile).
  • First-event snapping of randomForestSRC partial horizons.

Also

  • Roxygen: "Reading the plot" in ?gg_varpro; "Factors, bands and small data" in ?gg_partial_varpro; a first-event note in ?gg_partial_rfsrc.
  • vignettes/precompute_varpro_small.R writes varpro_small_precomputed.rds (23 KB), so the vignette rebuild stays cheap.
  • _pkgdown.yml article entry; news fragment news/docs-varpro-small-data.md. No version bump.

Verification (on 8420595, rebased on 3376c19)

  • devtools::document(): clean. lintr: 0 lints.
  • NOT_CRAN=true VDIFFR_RUN_TESTS=true devtools::test(): 0 failures, 0 errors, no snapshot changes.
  • R CMD check --as-cran with the manual, from a git archive build: Status 1 NOTE (CRAN incoming feasibility, update frequency). Examples with --run-donttest 32s, tests 20s, vignette rebuild 50s.

🤖 Generated with Claude Code

A companion to the varPro vignette, on the full PBC data with ten
permuted noise columns. It shows which variables varPro actually tested
(varpro_coverage(): eligible, tested, untested), what a z of zero means
(winsorising pulls a rarely scored term to exactly 0), how much the trim
and the 0.79 cutoff change the answer (little and a lot), checking a
screen against noise of each kind, and what partial dependence can say on
small data: the spread is not a confidence interval (five subsample
refits shown), survival horizons snap to event times (requests before the
first death all return its curve), and a factor is partialled one level
at a time by its one-hot names. That section also notes the label-order
bug fixed in #350 and varPro's remaining caveat: partialpro() leaves a
factor's other level columns set, which here moves the stage 4 partial
by 0.003.

Every fit is precomputed (precompute_varpro_small.R), so the R CMD check
rebuild grows no forest. varpro.qmd gains a short section pointing to the
new vignette and corrects how the importance plot is ordered (median)
versus highlighted (z). ?gg_varpro, ?gg_partial_varpro and
?gg_partial_rfsrc document the same points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- _pkgdown.yml: list varpro-small-data in the articles index
  (pkgdown requires every vignette there; check_pkgdown() now clean).
- Vignette: the attribution sentence no longer says every behaviour is
  upstream; the label bug, clamping and coverage rule are ggRF's own.
- ?gg_partial_varpro: the multi-level check sentence stands on its own.
- NEWS (#350): $categorical$variable now holds $xvirtual values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.48%. Comparing base (3376c19) to head (c2fc5f8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #351   +/-   ##
=======================================
  Coverage   91.48%   91.48%           
=======================================
  Files          61       61           
  Lines        6180     6180           
=======================================
  Hits         5654     5654           
  Misses        526      526           
Files with missing lines Coverage Δ
R/gg_partial_rfsrc.R 90.19% <ø> (ø)
R/gg_partial_varpro.R 96.44% <ø> (ø)
R/gg_varpro.R 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- z = 0 is ambiguous: low coverage forces it, but a fully tested term
  whose compared outcome means agree also gets 0. Read coverage beside z.
- Untested trees pull the box toward 0 as coverage falls; they do not make
  every box start at 0 (vignette and ?gg_varpro).
- partialpro() samples training cases uniformly, builds virtual twins and
  filters them by support; importance rules do not select the cases.
- The local and marginal panels come from different forests; say so, and
  point to gg_partial_rfsrc(vp$rf) to separate method from fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehrlinger
ehrlinger merged commit 54313ad into main Oct 15, 2026
7 checks passed
@ehrlinger
ehrlinger deleted the docs/varpro-small-data branch October 15, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants