Which variables you actually get: varpro screens twice before
anything reaches partial dependence. The split-weight screen decides which
predictors are worth guiding the trees with, and what survives it lands in
object$xvar.names; varPro::get.topvars then ranks a shorter
list out of that. So the design matrix, the reachable set, and the default
list are three different sizes -- a fit on 45 predictors might carry 26 in
object$xvar.names and 15 in get.topvars. partialpro
can only reach the middle one. How much gets screened off depends on the
data and the fit, so check rather than assume: length(object$xvar.names)
against ncol(object$x) tells you where you stand.
This bites when you bring a variable list in from somewhere else, say the
top names off an rfsrc VIMP ranking. partialpro intersects
your xvar.names with what it can reach and keeps the overlap without
remarking on it, so a request for twelve variables can come back with ten
and nothing in the result says so. It is the intermittent kind of trap: a
top-10 list may come back whole while a top-12 list quietly loses two. We
compare the two sets before calling partialpro and warn, naming what
was dropped. A quick setdiff(my_names, object$xvar.names) answers
the same question before you spend the computation.
For a complete view, fit with both screens off:
varPro::varpro(..., sparse = FALSE, split.weight = FALSE).
split.weight = FALSE is the one that lifts the ceiling -- it puts
every predictor in object$xvar.names, so partial dependence can reach
them all, and it leaves a strong variable's curve where it was.
sparse = FALSE does the smaller thing, deepening
varPro::get.topvars so the reported ranking shows its tail rather than
the screened top. Both are varPro's own arguments, and its defaults
(both TRUE) go the other way, toward the screened set; keep the
defaults when that sparser set is what you want. nvar is not the
knob here -- it only caps how much gets reported.
Scale detection: with scale = "auto" and an object in
hand, the scale resolves to "mortality" for a survival forest and
"generic" for a regression or classification forest. The RMST
horizon \(\tau\) is not stored in the varpro object
(varPro 3.1.0), so RMST output requires you to pass
scale = "rmst", time = tau explicitly.
RMST partial dependence (scale = "rmst"): varPro::partialpro
has no time argument, so its default survival learner returns ensemble
mortality at every horizon -- passing a horizon through ... is
silently dropped, and multi-horizon plots built that way differ only by
Monte-Carlo noise, not by \(\tau\). To get a genuine RMST(\(\tau\))
curve, scale = "rmst" supplies partialpro a learner
that returns \(\mathrm{RMST}(\tau)=\int_0^\tau S(t)\,dt\) from the
survival forest, so the curve actually depends on \(\tau\). This path
recomputes from object, so it needs object (a
survival fit) with part_dta = NULL; a precomputed part_dta
can only be relabeled, and gg_partial_varpro warns when you try.
A \(\tau\) beyond the model's largest event time is truncated there
(with a warning), since \(S(t)\) cannot be extrapolated.
Classification scale (scale = "prob"/"odds"/"logodds"):
varPro::partialpro returns classification effects as log-odds
of the target class. scale = "prob" (the classification default)
back-transforms to probability \(P(Y = \mathrm{target})\), "odds" to
the odds, and "logodds" keeps the raw scale. The back-transform is
applied per observation before averaging, so the curve is the mean
predicted probability, not the probability of the mean log-odds. The
causal contrast is shown only on "logodds" (see
plot.gg_partial_varpro).
Survival probability (scale = "surv"): scale = "surv" (the
survival default) computes \(S(\tau \mid x)\) through partialpro
(the same UVT engine as mortality and RMST), bounded in \([0, 1]\). When
time is not supplied, \(\tau\) defaults to the median
follow-up time of the fit -- a data-driven horizon that is always in the
model's own time units, so it cannot be mis-specified the way a hand-typed
\(\tau\) can. The resolved \(\tau\) is reported in a message and the
axis label; pass time = tau to choose another. scale =
"mortality" keeps the unbounded ensemble-mortality score as an explicit
opt-in.
Ensemble mortality (scale = "mortality"): here the y-axis is
ensemble mortality, the expected number of events a subject would
see if they were exposed to the study-average cumulative hazard. It is
the same quantity as the rfsrc predicted value for survival
forests (Ishwaran, Kogalur, Blackstone & Lauer, 2008
doi:10.1214/08-AOAS169). This is an unbounded relative-risk
score, not a survival probability and not \(1 - S(t)\); don't
read it as one. For a bounded, time-anchored survival summary, use
scale = "rmst", time = tau (restricted mean survival time, in the
time units of the outcome) or scale = "surv" / "chf".
Arguments are documented on gg_partial_varpro; this alias
shares its formals and forwards every argument unchanged.