Repository navigation
Add multiple sources, separate penalties, and example data - #5
Open
Jodielidada wants to merge 4 commits into
Open
Jodielidada wants to merge 4 commits into
Jodielidada wants to merge 4 commits into
Conversation
This was referenced Oct 16, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
==========================================
+ Coverage 90.22% 97.95% +7.72%
==========================================
Files 4 5 +1
Lines 174 244 +70
==========================================
+ Hits 157 239 +82
+ Misses 17 5 -12 ☔ 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
Adds weighted multiple-source fitting to
learner(),dlearner(), andcv.learner(), plus separate row/column penalties and cross-validation over them. Addsdat_multisourcewithY_targetandY_source = list(A, B), independently generated noise, documented generation code usingusethis::use_data(), and an example comparing the source choices. Method documentation and NEWS are revised. Replaces #3; plotting is in #6.Adds a second example comparing noisier sources in
inst/examples/multiple-sources.R, without changing the built-in dataset. In this example, the weighted combination has lower error than either source alone, but higher error than SVD using only the target data.Behavior changes
Existing single-source call patterns are retained, but validation and failure handling are stricter: negative penalties and ranks above the smaller matrix dimension are rejected; non-finite optimization updates stop immediately with code 3 and retain the best estimate; CV excludes non-finite scores, warns if some candidates fail, and errors if all fail.
dlearner()now returnsras an integer. For finite updates, the objective change and growth stopping rules and their defaults are unchanged. Automatic rank selection and LEARNER initialization use the first source.Testing
Tests cover compatibility, weighted projections, CV, gradients, stopping/failure behavior, and reference outputs from
learnerv20.3.0. LocalR CMD check --no-manual --no-build-vignettes: Status OK (macOS, R 4.6.1). GitHub Actions pass on macOS, Windows, and Ubuntu (release, devel, oldrel). PDF manual generation and actual OpenMP multithreading were not verified locally.