Skip to content

15/ Defaults and dependencies: no rebalancing and serial by default; five packages to Imports, three dropped - #141

Draft
ellispatrick wants to merge 4 commits into
review/integrationfrom
review/15-defaults-deps
Draft

ellispatrick wants to merge 4 commits into
review/integrationfrom
review/15-defaults-deps

Conversation

@ellispatrick

@ellispatrick ellispatrick commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Part 15 (#140 → this → #142 → #143). Based on #140, which holds #135–#139 together. Each commit can be accepted or rejected on its own.

Summary

crossValidate results are unchanged; defaults of runTest and runTests change.

  • No class rebalancing by default (Q33): ModellingParams() no longer downsamples by default.
  • Serial by default (Q34): CrossValParams() runs on one core by default.
  • Fewer attached packages (Q37): generics, S4Vectors, MultiAssayExperiment, BiocParallel and survival move from Depends to Imports, and ggpubr, reshape2 and broom are dropped.
  • easyHard fix: its lambda filter no longer drops a lambda whose coefficients sum to zero.

Why

Ellis Patrick's decisions, ProjectClassifyR docs/DECISIONS.md, 10 October 2026:

  • Q33, "Default 'none'":
    • runTests and crossValidate never applied the downsampling default; only a direct runTest call did (audit Q-C1).
    • The default now matches what cross-validation does.
  • Q34, "Serial":
    • bpparam() gave as many workers as the computer has cores, less two (125 on our server), and no seed.
    • So default runTests runs were not reproducible.
    • Serial runs are reproducible after set.seed.
  • Q37, "Both":
    • Bioconductor's guidance is to import packages rather than attach them.
    • The three dropped packages were each used once.

What changes

  • ModellingParams(balancing = c("none", "downsample", "upsample")):
    • The help page and vignette say the default is no rebalancing.
    • Direct runTest calls no longer downsample the training samples unless asked.
  • CrossValParams(parallelParams = SerialParam()):
    • The help page explains how to use several cores reproducibly (e.g. MulticoreParam(workers = 4, RNGseed = 1)).
    • crossValidate is unaffected; it already built its own seeded parameter.
  • Depends → Imports:
    • library(ClassifyR) attaches 1 package instead of 15, and puts 52 objects on the search path instead of 1,602.
    • train, Surv and DataFrame are re-exported, so code using them keeps working.
    • Users who call functions such as SerialParam, MulticoreParam, MultiAssayExperiment, colData, mcols or Pairs directly now need library() of that package, or pkg::.
    • The examples and the vignette now qualify such calls.
  • Dropped packages:
    • ggpubr: crissCrossPlot draws its two heatmaps (feature selection and random features) as two facets of one ggplot with a shared legend. Before, ggarrange combined two plots.
    • reshape2: the long table is built with base R.
    • broom: easyHard makes the coefficient table (term, estimate, std.error, statistic, p.value) from summary(glm). The "full" mode returns a DataFrame, as documented; it returned a tibble.
  • easyHard(fitMode = "full"): the lambda filter keeps lambdas at which any coefficient is not zero. The signed sum could be zero by cancellation.

Evidence

  • Tests and check:
    • R CMD check's test run passes (439 expectations, none failing, 2 skipped).
    • R CMD check (tests, examples, vignettes) gives 1 NOTE, the existing undeclared global variables of the plotting code.
  • Regression harness: all 18 scenarios are identical to int/ #135–#139 together for testing (not for merging) #140's build.
  • easyHard: single and full modes on asthma with clinical covariates are identical to the broom version.
  • crissCrossPlot:
    • With one panel (modelTrain), the plot is identical to before.
    • With two panels (modelTest with random features), it shows the same tiles, values and diagonal outlines as before, in two facets with one legend.
  • Scripts and images: ProjectClassifyR scripts/structure/deps_evidence.R, results/structure/.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4

ellispatrick and others added 4 commits October 14, 2026 10:49
…direct runTest calls)

runTests and crossValidate never applied the downsampling default; only a direct runTest call did.
The default now matches what cross-validation does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
…fter set.seed (changes results of default runs)

bpparam() gave as many workers as the computer has cores less two (125 on a large server) and no seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
… and survival move from Depends to Imports; ggpubr, reshape2 and broom are dropped

- train, Surv and DataFrame are re-exported, so they work after library(ClassifyR) alone.
- crissCrossPlot draws its two heatmaps as facets of one ggplot (shared legend) instead of ggpubr::ggarrange,
  and builds its long table without reshape2::melt.
- easyHard builds its coefficient table from summary(glm) instead of broom::tidy (same columns); the "full" mode
  now returns a DataFrame, as documented.
- Examples and the vignette name the package of functions that are no longer attached (BiocParallel::SnowParam,
  MultiAssayExperiment::MultiAssayExperiment, S4Vectors::Pairs, S4Vectors::mcols). The vignette also says that
  runTests runs on one core by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
…ot those whose coefficients sum to a non-zero value

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4

This branch has not been deployed

No deployments
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.

1 participant