Repository navigation
Add multiple-source transfer learning and separate row/column penalties - #3
Closed
Jodielidada wants to merge 4 commits into
Closed
Jodielidada wants to merge 4 commits into
Jodielidada wants to merge 4 commits into
Conversation
Integrate the learnerv2 0.3.0 extensions into the R and C++ package interfaces, including weighted source operators and cross-validation for independent penalties. Preserve the common-penalty interface and add documentation, examples, reference regression tests, and stopping-rule tests. Prepare version 1.1.0 and add Jodie Li as a package author. Validation: R CMD check --no-manual passed with 151 test assertions; additional original-package and learnerv2 comparisons passed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3 +/- ##
==========================================
+ Coverage 90.22% 95.02% +4.79%
==========================================
Files 4 5 +1
Lines 174 241 +67
==========================================
+ Hits 157 229 +72
+ Misses 17 12 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the multiple-source and separate-penalty extensions from the preliminary
learnerv20.3.0 implementation into the package's R/C++ code. These extensions correspond to the Supporting Information variants of LEARNER. The existing single-source, common-penalty interface is unchanged, and the existing tests frommainpass without modification.What's new
learner(),cv.learner(), anddlearner()now accept a list of aligned source matrices forY_source, plus optionalsource_weights. Weights must be nonnegative and are normalized to sum to one. They combine the source projection operators as in Remark 2 of the paper.learner()gainslambda_1_row/lambda_1_colarguments, which penalize the U-space and V-space residuals separately. If the two are equal, the result is the same as the common-penalty fit.cv.learner()gainslambda_1_row_all/lambda_1_col_allarguments. In that mode it returns a 3-D score array (row × column × balance grid). Common-penalty calls return the same structure and score scale as before.inst/examples/multiple-sources.Ris new.Behavior notes
ris not supplied, automatic rank selection (ScreeNOT) uses the first source. LEARNER initialization also uses the first source, even whenris supplied.Backward compatibility
tests/testthat/test-main.Rfrommainpasses against this branch (11/11).Testing
R CMD check --no-manual: Status OK (0 errors, 0 warnings, 0 notes) on macOS, R 4.6.1.The test suite has 151 passing expectations. New test files:
test-separate-penalties.Rtest-cv-multisource.Rtest-stopping-behavior.Rtest-reference-regression.RRegression tests compare the implementation against reference outputs from
learnerv20.3.0 (tests/testthat/fixtures/multisource-v030.rds, tolerance 1e-8). The fixtures cover:Automatic rank selection is not covered. The generator script and its provenance are in
tests/testthat/fixtures/.GitHub CI also passes on macOS and Windows (R release), and Ubuntu (R release, devel, and oldrel-1).
Not tested locally: OpenMP multithreading; the local macOS build has no OpenMP support. Actual multithreaded execution in CI has not been independently verified. PDF manual generation was not checked (
--no-manual).