Repository navigation
CRAN release, accepted 2026-10-25. Tagged on ba5c923e, the tree submitted to CRAN (recorded in CRAN-SUBMISSION).
gg_ivarpro()no longer fails with "replacement has 1 row, data has 0"
when every local-importance value for a class is nonfinite. The empty
per-class frame now takes itsclasscolumn without error: a fit where
every class is empty returns an emptygg_ivarpro, and one where only some
are drops those classes. Reported by Udaya Kogalur.gg_ivarpro()on a binary classification forest labelled its profile
with the wrong class.varPro::ivarpro()explains one class there, the
first factor level (itstargetattribute says so), andgg_ivarpro()
filed that profile under the last level, the default. Every binary
gg_ivarpro()plot therefore showed the first class's slopes, sign
included, under the second class's name. Because the two class
probabilities sum to one, the second class's slopes are the first's
negated, sogg_ivarpro()now derives it exactly and both levels are
available throughwhich_class. The default stays the last level, now
with the right values. Underuse.abs = TRUEthe two profiles are equal.gg_ivarpro()mirrors a binary profile into the second class only when it
explains the forest's own probability of the first level. Ay.external
target named after a class is any numeric response, not a class
probability, and is kept as a single profile, as before.varPro(>= 3.3.0) is now required, up from 3.1.0.ivarpro()records
the class it explains (itstargetattribute) only from 3.2.1, and the
corrected binarygg_ivarpro()depends on it; 3.3.0 is the version tested
and the one on CRAN.gg_partial_varpro()labelled categorical partials in the wrong order.
Each column ofvarPro::partialpro()'s output belongs to one value of
$xvirtual(sorted values, or factor levels), but the labels were taken
from the order values first appear in the sampled cases, so a 0/1 variable
could have "0" and "1" swapped and a multi-level variable had its levels
shifted, whenever the two orders differed. On the PBC data this made stage
4 and severe edema look protective. Categorical partials are now labelled
by$xvirtual, in the factor's own level order (and ordered status) when
part_dtacarries factor-valuedxorg.
The precomputed varpro vignette objects are rebuilt, so the Bostonrad
and PBCedemapanels now carry the right labels.gg_varpro(conditional = TRUE)on a binary classification forest now
labels its classes with the outcome's own level names. varPro recodes a
binary outcome to 0/1 internally and names its conditional columns after
those codes, so the facets read0and1instead of, say,NandR.
gg_ivarpro()already mapped them back;gg_varpro()now does the same,
and$conditional$classis a factor in the outcome's level order.
Multiclass outcomes, which varPro does not recode, are unchanged, including
ones whose own labels are"0","1", ...plot.gg_varpro()draws no bar for an undefined class-conditional z
instead of a zero bar that reads as "tested and unimportant". The z is
0/0 when too few trees tested a variable for that class, which happens
with default settings becausegg_varpro()callsvarPro::importance()
withlocal.std = FALSE. The variable keeps its row, including one varPro
leaves out of every class, every class keeps its facet, and the caption
says the z is undefined (#344).gg_partial_varpro(scale = "surv")no longer returns survival above 1.
partialpro()smooths each case's S(tau) with an unbounded polynomial, so
where survival is near 1 (early horizons, before most events) the averaged
curve ran up to about a percentage point past it. The curve is now clamped
to [0, 1] after averaging, and the categorical frame per value. Only the
impossible values change; everything in range is exactly as before.
Smoothing on the logit scale was tried and rejected:partialpro()replaces
each case's intercept with the cohort mean, so on that scale the curve's
level depends on how S = 0 and S = 1 are clamped. A precomputedpart_dta
labelled"surv"passes through unchanged.
The varpro vignette's precomputed PBC partial is rebuilt: itsedema
panel had 60 values below 0, now 0.?gg_partial_varprono longer says thatscale = "surv"is computed
throughgg_partial_rfsrc(). Onlyscale = "chf"takes that route;
"surv"uses thepartialpro()S(tau) learner, and itstimeis the
horizon tau, defaulting to the median follow-up time.- Two tests no longer depend on the
randomForestSRCrandom-number stream.
The livegg_sdependent()test computes its beta fit once and gives it to
both sides, and theplot.gg_varpro()test for a class with no defined z
sets that z by hand. Both failed against therandomForestSRCdevelopment
release, whose new seed generator grows a different forest from the same
seed.