Skip to content

scdef.tl.compute_hierarchy_scores

compute_hierarchy_scores(model: scDEF, use_filtered: bool = False, filter_upper_layers: bool = True, factor_weight: str = 'uniform', eps: float = 1e-12) -> Dict[str, Any]

Compute per-factor and global hierarchy scores from learned W matrices.

Parameters:

Name Type Description Default
model scDEF

scDEF model instance

required
use_filtered bool

whether to use model.factor_lists / model.factor_names

False
filter_upper_layers bool

when use_filtered is False, whether to still use filtered factors for layers > 0 (both as parents and children)

True
factor_weight str

weighting scheme for factors, either "uniform" or "usage"

'uniform'
eps float

small epsilon value for numerical stability

1e-12

Returns:

Type Description
Dict[str, Any]

dict containing per_factor (index = child factor name, child_factor

Dict[str, Any]

column retained; includes avg_clarity and avg_n_eff_parents for L0),

Dict[str, Any]

per_transition, global_score, and global_ambiguity.