Computes feature inclusion frequencies and pairwise Jaccard similarity between all Pareto-optimal solutions. Accepts either an OptimizationResult (preferred — contains all Pareto solutions) or a BiomarkerPanelResult (legacy path).

analyze_feature_stability(
  result,
  feature_type = c("features", "base_features")
)

Arguments

result

An OptimizationResult or BiomarkerPanelResult.

feature_type

One of "features" (default) or "base_features". When "base_features", counts original gene names rather than transformed feature names (e.g. pairwise ratios). Only supported for OptimizationResult input.

Value

A list with class "FeatureStabilityResult" containing:

frequencies

Data frame with columns feature, count, proportion ordered by descending count.

jaccard_matrix

Symmetric matrix of pairwise Jaccard similarity coefficients between solutions. Row/column names are solution_id values.

n_solutions

Integer count of Pareto-optimal solutions analyzed.

mean_jaccard

Mean pairwise Jaccard similarity (excluding diagonal).

Examples

if (FALSE) { # \dontrun{
# From an OptimizationResult (preferred):
stability <- analyze_feature_stability(opt_result)
stability$frequencies
plot_feature_stability(stability)

# Gene-level frequencies with pairwise transforms:
stability_genes <- analyze_feature_stability(opt_result,
                                             feature_type = "base_features")
} # }