Backport #309 to maint/v3 (3.5.4) - #312
Merged
Merged
Conversation
Mortality, grouped survival lines and factor xvar2 in gg_partial_rfsrc: - partial.type = "mort" no longer errors under the default partial.time; the time column is left off for mortality. - plot.gg_partial_rfsrc() continuous panel facets on grp when a survival forest has xvar2.name; the y label follows partial.type in every branch. - A factor xvar2.name is passed to partial.rfsrc() as integer codes and grp is labelled with the levels. Adapted for maint/v3: no labels= argument here, so the shared facet helper takes no strip labeller; the xvar2.name doc keeps v3's wording plus the factor sentence. NEWS goes under the unreleased 3.5.4. (cherry picked from commit 9ca657b) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## maint/v3 #312 +/- ##
============================================
+ Coverage 89.12% 89.40% +0.27%
============================================
Files 50 50
Lines 4682 4699 +17
============================================
+ Hits 4173 4201 +28
+ Misses 509 498 -11
🚀 New features to boost your workflow:
|
partial.rfsrc() imposes a level by its integer code in the model, and make_eval_grid() and partial_with_group() took those codes from newx's own levels. newx is checked only by column name, so a factor re-levelled there passed one level's code under the other's label, for xvar.names and xvar2.name alike. Map through the model's levels and stop on a level the forest was not trained on. Raised in review on #309. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2fcf7d0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Added Re-run on |
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.
Backports #309 to
maint/v3, ahead of the 3.x release. 3.5.4 is unreleased (CRAN has 3.5.3), so the NEWS bullets go under 3.5.4 and the version stays put.What it fixes in
gg_partial_rfsrc()/plot.gg_partial_rfsrc():partial.type = "mort"stopped with "replacement has 3 rows, data has 23" under the defaultpartial.time. Mortality is summed over every event time, so its data now carry notimecolumn, and both panels are labelled "Predicted Mortality".On a survival forest with
xvar2.name, the continuous panel now gives each level its own panel, one line per time horizon, instead of one zigzag per time.A factor
xvar2.nameis passed topartial.rfsrc()as integer codes, andgrpcomes back as a factor holding the labels.Factor levels are now coded by the fitted forest, not by
newx(2fcf7d0a, raised by Copilot on fix: mortality, grouped survival lines and factor xvar2 in gg_partial_rfsrc #309). A factor re-levelled innewxhad passed one level's code under the other's label, forxvar.namesandxvar2.namealike. A level the forest was not trained on is now an error.Adapted for maint/v3
This is a cherry-pick of
9ca657b2and2fcf7d0a(-x). The second applied clean; the first needed these conflicts resolved:plot.gg_partial_rfsrc()has nolabels =argument, so the sharedpartial_rfsrc_facet()helper takes no strip labeller here, and the facets match v3's existing calls.xvar2.nameroxygen keeps v3's wording and adds only the factor sentence. Main's longernewxtext came from a separate change that was never backported.Verification (on this branch)
devtools::document(), thenlintr::lint_package(): 0 lintsNOT_CRAN=true VDIFFR_RUN_TESTS=true devtools::test(): FAIL 0, SKIP 5, PASS 1615. The newgg-partial-rfsrc-continuous-survival-by-groupbaseline from main matches v3's rendering unchanged; 52 baselines before and after.R CMD check --as-cranwith the manual, from agit archiveexport: 1 NOTE (CRAN incoming feasibility). Timed steps total 213 s locally. Tarball 2.4 MB, with no hidden files other than.Rinstignore.🤖 Generated with Claude Code