Skip to main content

Module nonparametric

Module nonparametric 

Source
Expand description

Nonparametric & multiple-comparison tests (CI-SKM ch 6) — distribution-free tests for paired and multi-group comparisons, the standard tools for comparing classifiers/estimators across datasets. Real p-values from the χ²/F CDFs in distributions; within-block ranking reuses the statistics ranker.

Structs§

FriedmanResult
Friedman test result, including the Iman-Davenport F-correction.
KolmogorovSmirnovResult
Kolmogorov-Smirnov one-sample test vs uniform[0,1] for demo. Returns D statistic and rough p.
MannWhitneyResult
Mann-Whitney U test (rank sum) for two independent samples. Returns U statistic, p approx using normal for large n, or exact for small. Simplified normal approx for demo.
NonparametricResult
Result of a χ²-based test.

Functions§

friedman
Friedman test for k treatments across n blocks (e.g. classifiers × datasets), data[block] of length k (the measurements, higher = better). Ranks within each block (ties averaged), then tests whether the treatments differ. None if fewer than 2 blocks / 2 treatments or ragged input.
ks_1sample
mann_whitney_u
mcnemar
McNemar’s test for two paired binary classifiers: b is the count where A is right and B wrong, c where A is wrong and B right (the discordant cells of the 2×2 agreement table). Uses the continuity-corrected statistic (|b−c|−1)²/(b+c) ~ χ²₁. None if b + c == 0 (no discordance).