Skip to content

Commit 6c5bbd3

Browse files
committed
docs: address PR #95 Copilot review
- plot.gg_udependent: clarify that truly isolated nodes are dropped by gg_udependent() before plotting; reword 'Isolated' as 'low-degree'. - gg_partial_varpro: fix varpro::partialpro -> varPro::partialpro (six instances) so \link{} renders correctly. - plot.gg_varpro: clarify the cutoff line lives in z-units on the default axis and in raw-importance units when type='raw'; the numeric is the same, the scale is not. - gg_varpro reference: complete the dangling 'arXiv 2409.' with the full arXiv:2409.09003 identifier and an https://arxiv.org link.
1 parent e04d0a9 commit 6c5bbd3

8 files changed

Lines changed: 32 additions & 18 deletions

R/gg_partial_varpro.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##=============================================================================
22
#' Partial dependence data from a varPro model
33
#'
4-
#' \code{varpro::partialpro} returns one list, with continuous and
4+
#' \code{varPro::partialpro} returns one list, with continuous and
55
#' categorical predictors mixed together. This function splits that list into
66
#' two tidy data frames, one for each kind, and resolves the y-axis label the
77
#' plot method will use.
@@ -10,7 +10,7 @@
1010
#' A partial dependence curve answers the question, "if I hold a single
1111
#' variable at a grid of values and average out everything else, how does
1212
#' the model's prediction move?" That is the same question \code{rfsrc}
13-
#' partial dependence answers. What \code{varpro::partialpro} adds is two
13+
#' partial dependence answers. What \code{varPro::partialpro} adds is two
1414
#' wrinkles that are worth understanding before you read the curves.
1515
#'
1616
#' First, \code{partialpro} filters the partial grid through an isolation
@@ -65,14 +65,14 @@
6565
#' estimator, not a structural causal claim about the data-generating
6666
#' process.
6767
#'
68-
#' @param part_dta Partial plot data from \code{varpro::partialpro}. Each
68+
#' @param part_dta Partial plot data from \code{varPro::partialpro}. Each
6969
#' element must contain \code{xvirtual}, \code{xorg}, \code{yhat.par},
7070
#' \code{yhat.nonpar}, and \code{yhat.causal}. Supply at least one of
7171
#' \code{part_dta} or \code{object}.
7272
#' @param object A fitted \code{varpro} object, the forest the partial data
7373
#' came from. When supplied it provides the provenance metadata, and when
7474
#' \code{part_dta} is \code{NULL} it is passed to
75-
#' \code{varpro::partialpro(object)} for you. Required when
75+
#' \code{varPro::partialpro(object)} for you. Required when
7676
#' \code{scale \%in\% c("surv","chf")}.
7777
#' @param scale Character; sets the y-axis label and, for survival forests,
7878
#' the output type. One of \code{"auto"} (default), \code{"mortality"},

R/gg_varpro.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
#'
7070
#' @references
7171
#' Lu, M. and Ishwaran, H. (2024). Model-independent variable selection
72-
#' via the rule-based variable priority. \emph{arXiv} 2409.
72+
#' via the rule-based variable priority framework. \emph{arXiv preprint}
73+
#' \href{https://arxiv.org/abs/2409.09003}{arXiv:2409.09003}.
7374
#'
7475
#' @param object A fitted \code{varpro} object (required).
7576
#' @param local.std Logical; default \code{TRUE}. When \code{TRUE} the

R/plot.gg_udependent.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
#' stronger dependencies; thin, faint edges sit near the threshold and
1919
#' are the ones that would disappear first if you raised it.
2020
#'
21-
#' Isolated, grey, low-degree nodes are the ones UVarPro thinks are
22-
#' not contributing much to the structure. A cluster of mutually
21+
#' Grey, low-degree nodes are the ones UVarPro thinks are not
22+
#' contributing much to the structure. (Truly isolated nodes are
23+
#' dropped by `gg_udependent()` before the graph is drawn — what you
24+
#' see is the connected component.) A cluster of mutually
2325
#' connected variables is worth checking for redundancy — they may be
2426
#' several views of the same underlying quantity.
2527
#'

R/plot.gg_varpro.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313
#' For each variable the box spans the 15th to 85th percentile of the
1414
#' per-tree scores, the centre line is the median, and the whiskers run
1515
#' out to the 5th and 95th percentile — not the usual Tukey 1.5 IQR
16-
#' whiskers. The dashed vertical line is the selection cutoff (default
17-
#' \code{z = 0.79}); boxes whose aggregate z sits above it are coloured
18-
#' blue and flagged \code{selected = TRUE}, the rest are grey. A
16+
#' whiskers. The dashed vertical line is the selection \code{cutoff}
17+
#' (default \code{0.79}). On the default z-score axis
18+
#' (\code{local.std = TRUE}) that line is a z; on the raw-importance
19+
#' axis (\code{local.std = FALSE}, \code{type = "raw"}) it is the same
20+
#' numeric value but in raw-importance units. Boxes whose aggregate
21+
#' value sits above the line are coloured blue and flagged
22+
#' \code{selected = TRUE}, the rest are grey. A
1923
#' selected variable with a tight, high box is a variable the forest
2024
#' agrees on across trees. A selected variable with a wide box that
2125
#' straddles the cutoff is one to look at twice before relying on it.

man/gg_partial_varpro.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/gg_varpro.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.gg_udependent.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.gg_varpro.Rd

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)