Supervised Metrics¶
These metrics require class labels y alongside the embedding matrix X.
Variance ratio¶
shesha.variance_ratio() computes the between-class to total variance ratio
(analogous to the F-statistic). Quick proxy for linear separability.
score = shesha.variance_ratio(X, y)
Supervised alignment¶
shesha.supervised_alignment() correlates the empirical RDM with the ideal label
RDM (same-class = 0, different-class = 1). High values mean geometry respects labels.
alignment = shesha.supervised_alignment(X, y)
Class separation ratio¶
shesha.class_separation_ratio() estimates the ratio of between-class to
within-class pairwise distances via bootstrap resampling.
ratio = shesha.class_separation_ratio(X, y, n_bootstrap=50)
LDA stability¶
shesha.lda_stability() measures how consistently LDA finds the same discriminant
direction across bootstrap resamplings of the data.
stability = shesha.lda_stability(X, y, n_bootstrap=50)
Bootstrap confidence intervals¶
All supervised metrics support optional bootstrap CIs via n_bootstrap_ci.
See Bootstrap Confidence Intervals for full details.
result = shesha.variance_ratio(X, y, n_bootstrap_ci=1000, seed=320)
print(f"{result['mean']:.3f} [{result['ci_low']:.3f}, {result['ci_high']:.3f}]")