HabitatFeatureComparison
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- class HabitatFeatureComparison(panel: HabitatFeaturePanel, summary: DataFrame, pairwise: DataFrame, n_subjects: int, paired: bool, effect: str)[source]
Bases:
objectDescriptive and (when n>=2) inferential habitat-vs-habitat contrast.
- panel
The long panel the comparison was computed from.
- summary
Per habitat x feature: n, mean, median, q25, q75.
- Type:
pandas.core.frame.DataFrame
- pairwise
Per feature x habitat pair: n_paired, mean_diff, cliffs_delta, p_value, q_value. Inferential columns are NaN when the panel has one subject or too few complete pairs.
- Type:
pandas.core.frame.DataFrame
- top_features(k: int = 8, *, pair: Tuple[int, int] | None = None) Tuple[str, ...][source]
Rank features by absolute effect size (largest first).
- Parameters:
k – Maximum number of names to return.
pair – Optional
(habitat_a, habitat_b)to restrict ranking. When omitted, each feature uses its largest absolute effect across pairs.
- Returns:
Feature names, length
min(k, n_features).