Compute Cluster-Specific IMD Without Pairwise IMD
Usage
cluster_imd(
x,
cluster = NULL,
dat.list = NULL,
connect_list = NULL,
min_cluster_size = 20L,
ntree = NULL,
ytry = NULL,
parallel = TRUE,
imd_normalized_weights = FALSE,
run_vs = FALSE,
vs_args = list(),
fit_args = list(),
imd_args = list(),
use_node_imd = FALSE,
keep_model = FALSE,
keep_data = FALSE,
seed = 529
)Arguments
- x
A
mrf3ormrf3_fitobject.- cluster
Optional cluster labels for samples.
- dat.list
Optional named omics list (samples in rows).
- connect_list
Optional global connection list used by all clusters.
- min_cluster_size
Minimum sample size required to run a cluster-specific IMD.
- ntree
Deprecated compatibility argument. Ignored in no-refit mode.
- ytry
ytryused for per-cluster IMD. IfNULL, reuses object setting. Only used by the depth-based path.- parallel
Logical; whether IMD computation inside each cluster is parallelized. Only used by the depth-based path (the node-score fast path is single-pass and needs no parallelism).
- imd_normalized_weights
Logical; passed to
get_multi_weights()asnormalized. The default isFALSEso cluster-level variable selection receives raw forest IMD on its 0-to-1 scale.- run_vs
Logical; whether to run
mrf3_vs()variable selection on each cluster after IMD.run_vs = TRUEforces the depth-based path, which builds the per-cluster subset models thatmrf3_vs()requires.- vs_args
A named list of additional arguments passed to
mrf3_vs()for each cluster.- fit_args
Deprecated compatibility argument. Ignored in no-refit mode.
- imd_args
Optional named list merged into each per-cluster
get_multi_weights()call. Supplying anyimd_argsforces the depth-based path, because the node-score fast path cannot honorget_multi_weights()options.- use_node_imd
Controls the estimator used for the per-cluster weights.
FALSE(the default) computes Eq. 6-8 inverse minimal depth via the per-tree network traversal ofget_multi_weights()on each cluster's subset model.TRUEuses the node-score fast path (cluster_weighted_imd()): the per-node split statistics stored during fitting are averaged per variable, weighted by the fraction of the cluster's samples whose root-to-leaf paths visit each node. The fast path is deterministic and typically 100-900x faster, but it is a different, split-score-weighted estimator whose weights stay close to the global importance ranking: in benchmarks its per-cluster weights correlate at Spearman 0.9-0.99 across clusters (depth path: 0.6-0.8), and agree with the depth-based weights at Spearman ~0.4-0.6 (top-20 overlap ~50-75%). Use it as a quick descriptive screen, not as a substitute for the depth-based cluster IMD (seecluster_weighted_imd()for the definition).NULLselects the fast path automatically whenever the models carry the requiredtree_infostatistics and no blocking option (imd_args,run_vs) is requested, falling back to the depth-based path otherwise.- keep_model
Logical; whether to keep per-cluster mrf3 objects in output.
- keep_data
Logical; whether to keep per-cluster subset data in output.
- seed
Base seed; cluster
iusesseed + i - 1.