Enhanced Version of create.hop.nbhd.extrema.df with Improved Spurious Classification
Source:R/gflow_cx.R
create.hop.nbhd.extrema.df2.RdCreates a data frame containing information about local extrema with multiple options for classifying spurious extrema.
Usage
create.hop.nbhd.extrema.df2(
result,
include_spurious = TRUE,
spurious_method = "threshold",
threshold = NULL,
quantile_level = 0.25,
sort_by_value = FALSE,
vertex_column_name = "vertex",
verbose = FALSE
)Arguments
- result
An object from compute.extrema.hop.nbhds() or create.gflow.cx()
- include_spurious
Logical; whether to include spurious extrema (default TRUE)
- spurious_method
Method for determining spurious extrema (see classify.spurious.extrema)
- threshold
Threshold for hop_idx (default 2, or from result object)
- quantile_level
Quantile level for quantile-based spurious detection (default 0.25)
- sort_by_value
Logical; if TRUE, orders extrema by function value (default FALSE)
- vertex_column_name
Character; name of the vertex column (default "vertex")
- verbose
Logical; print diagnostic information (default FALSE)
Value
A data frame with columns:
vertex: Vertex index
hop_idx: Hop index of the extremum
is_max: 0 for minima, 1 for maxima
label: Label for the extremum
spurious: Logical; whether the extremum is considered spurious
value: Function value at the extremum (if available)
Examples
result <- list(
lmin_hop_nbhds = list(
list(vertex = 1, hop_idx = 1, value = 0.2),
list(vertex = 3, hop_idx = 4, value = 0.1)
),
lmax_hop_nbhds = list(
list(vertex = 2, hop_idx = 2, value = 0.9),
list(vertex = 4, hop_idx = Inf, value = 1.2)
)
)
create.hop.nbhd.extrema.df2(result)
create.hop.nbhd.extrema.df2(result, spurious_method = "quantile", quantile_level = 0.33)