cleanup: assert on flat _zscore, doc the nll floor, trim history comments

_zscore now asserts nonzero variance (a flat profile drew a degenerate all-zero
map that looked valid) instead of dividing by std+1e-9. _soft_nll docstring now
states the 1e-12 floor it actually applies (was 'Unbounded'). Trim archaeology
comments (guided/wvs/read_api) to the invariant, dropping the dated model names.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-07-05 08:25:28 +08:00
co-authored by Claudypoo
parent 599b8528d3
commit b2e631132c
5 changed files with 14 additions and 10 deletions
+6 -2
View File
@@ -232,8 +232,12 @@ def plot_ordinal(run_dir: Path, out: Path, name: str, vec_label: str, C: float,
def _zscore(v: np.ndarray) -> np.ndarray:
"""Relative emphasis: centre and scale a profile across foundations, so a logit profile (model)
and a 1-5 wrongness profile (human cultures) are comparable by PATTERN regardless of units."""
return (v - v.mean()) / (v.std() + 1e-9)
and a 1-5 wrongness profile (human cultures) are comparable by PATTERN regardless of units. A
flat profile has no relative emphasis to show -- fail loud rather than divide by ~0 and draw a
degenerate all-zero map that looks valid."""
sd = v.std()
assert sd > 0, "flat profile (zero variance across foundations): relative-emphasis map is undefined"
return (v - v.mean()) / sd
def read_human_mfv() -> tuple[list[str], dict[str, dict[str, float]]]: