View source: R/gg_sdependent.R
| gg_sdependent | R Documentation |
Tidy wrapper around varPro::sdependent() for a uvarpro object. Where
gg_udependent() draws the cross-variable dependency graph,
gg_sdependent() surfaces sdependent()'s signal-variable detection: a
ranked table of the per-variable signal score and graph degree, with the
variables flagged as "signal" (those whose dependency structure clears the
detection threshold).
gg_sdependent(
object,
...,
threshold = 0.25,
q.signal = 0.75,
directed = TRUE,
min.degree = NULL,
beta_fit = NULL
)
object |
A |
... |
Forwarded to |
threshold, q.signal, directed, min.degree |
Passed to
|
beta_fit |
Optional precomputed |
sdependent() runs on the varPro::get.beta.entropy() lasso-coefficient
matrix and returns, with plot = FALSE, a list of imp.score (per-variable
signal score), degree (node degree in the dependency graph), and
signal.vars (the detected signal set). This wrapper tidies that into one
row per candidate variable, ranked by imp.score. Because the entropy
matrix is the expensive part, beta_fit accepts a precomputed
varPro::get.beta.entropy() matrix (shared with gg_beta_uvarpro() and
gg_udependent()).
A gg_sdependent object (a data.frame), one row per candidate
variable, most-signal first, with columns:
variablefactor; levels reversed so the top variable lands at
the top after coord_flip().
imp_scoresdependent() per-variable signal score.
degreenode degree in the dependency graph.
signallogical; variable is in sdependent()$signal.vars.
The provenance attribute records source, family ("unsupv"),
threshold, q.signal, directed, n_signal, and n_var.
gg_udependent() (the dependency graph), gg_beta_uvarpro()
(lasso importance), varPro::sdependent(), varPro::uvarpro().
if (requireNamespace("varPro", quietly = TRUE)) {
set.seed(1)
o <- varPro::uvarpro(mtcars, ntree = 50)
gg <- gg_sdependent(o)
plot(gg)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.