Prune a similarity matrix (TOM or adjacency) to enhance sparsity
Source:R/questions.R
prune_matrix.Rd
Supports thresholding or top-k nearest neighbors to reduce matrix density, improving interpretability and biological signal in diffusion tasks.
Arguments
- mat
A square similarity matrix (e.g., TOM or adjacency)
- value
A numeric threshold (if method = "threshold") or number of neighbors (if method = "topk")
- auto
If TRUE, determine threshold automatically to achieve target sparsity
- target_sparsity
Desired sparsity level (only used if auto = TRUE and method = "threshold")
- verbose
If TRUE, prints pruning diagnostics