Repository navigation
Add plots for objectives, CV, latent spaces, and contributions - #6
Merged
Merged
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 @@
## multisource-penalties-clean #6 +/- ##
===============================================================
+ Coverage 97.95% 99.18% +1.23%
===============================================================
Files 5 7 +2
Lines 244 614 +370
===============================================================
+ Hits 239 609 +370
Misses 5 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
Adds
plot_objective()for recorded optimization histories,plot_cv()for common/separate-penalty heatmaps,plot_source_spaces()for population projection matrices, andplot_contributions()for squared singular-vector entries. Only the CV heatmap needs optional ggplot2.Plotting behavior and examples
plot_objective()shows all iterations, a numeric selection (iterations beyond the recorded history are ignored), or a window of up to 41 iterations centered on the recorded minimum. README shows an objective plot for the single-source example, and CV output, its heatmap, and a comparison of source choices usingdat_multisource. Examples, help pages, and NEWS are updated.plot_cv_profile()from #4 is not carried over, to keep the package easier to maintain.README also presents the second source comparison added in #5, showing the results when both sources have appreciable noise.
Testing and merge order
Local tests and
R CMD check --no-manual --no-build-vignettespass (macOS, R 4.6.1), and GitHub Actions pass on macOS, Windows, and Ubuntu. Replaces #4 and depends on #5. Please merge #5 with a regular merge commit; if it is squash-merged, I will need to rebase this branch before merging it.Plot examples
Objective function
The same fit shown over all iterations, iterations 1–200, and a window of 20 iterations on either side of the minimum recorded value; the shaded band shows consecutive objective values, not uncertainty.
Cross-validation
The heatmap compares the candidate penalties, with a black box marking the selected combination.
Source spaces and contributions
The space plots compare the target and two source populations; the contribution plots show squared singular-vector entries for the three components of the fitted target matrix.