You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add normality and variance homogeneity statistical tests (#67)
* feat: add normality and variance homogeneity statistical tests
- config.py: add StatisticalTestThresholds (normality p-value, Shapiro
max-n cutoff, min sample size, Levene p-value and min group size)
wired into HashPrepConfig
- checks/statistical_tests.py: two new checks:
- normality: Shapiro-Wilk (n ≤ 5000) or D'Agostino-Pearson (n > 5000)
per numeric column; flags non-normal distributions with stat + p-value
in the issue description
- variance_homogeneity: Levene's test (median-centred, robust) across
target-column groups; reports std ratio alongside the test result;
skipped when no target column is set or groups are too small
- summaries/variables.py: embed normality result (test name, statistic,
p_value, is_normal bool) into each numeric column's summary dict; also
fix a pre-existing crash where infinite values in a column caused
np.histogram to receive range=(-inf, inf) — all distribution stats
now computed on finite-only values
- checks/__init__.py + core/analyzer.py: register normality and
variance_homogeneity in CHECKS registry and ALL_CHECKS list
- tests/test_statistical_tests.py: 30 tests covering normality check
unit, Levene check unit, summary embedding, and end-to-end integration
via DatasetAnalyzer; all 180 tests pass (150 existing + 30 new)
* style: apply ruff format to statistical_tests.py
0 commit comments