Wilcoxon Signed-Rank Test
The Wilcoxon Signed-Rank Test is a way to answer a very common question: “Did something change?”—when you have measurements taken in pairs, like before vs. after, or two methods applied to the same items. It’s especially handy when the data don’t look nicely bell-shaped, or when outliers make average-based tests feel risky.
What it tests (in plain terms)
The Wilcoxon Signed-Rank Test is a non-parametric test for paired data. It checks whether the typical (median) difference between paired observations is zero. You start by computing the difference within each pair (e.g., “after − before”), then it uses the ranks of the absolute differences while keeping track of their sign (positive or negative). If most of the larger differences point in one direction, the test statistic becomes large and the p-value becomes small.
When you’d use it
- Before/after measurements on the same people (blood pressure pre/post treatment).
- Matched pairs (two teaching methods tested on the same students via two exams).
- Model comparisons where each dataset fold yields a paired score (AUC of model A vs. B per fold).
Why it matters in AI/ML
In ML, performance scores across folds, users, or time periods are often skewed and noisy. The Wilcoxon test gives a robust way to compare two approaches without assuming normality like a paired t-test does. It’s commonly used in evaluation pipelines to support claims such as “model B significantly improves accuracy over model A” when results vary across folds or subjects.
Practical notes and assumptions
- Pairs should be independent of other pairs.
- The distribution of differences should be roughly symmetric (not necessarily normal).
- It tests a shift in location (median difference), not general distributional changes.
Wilcoxon Signed-Rank Test is a nonparametric hypothesis test for paired data that assesses whether the median of the within-pair differences is zero, using ranks of absolute differences with signs. It is useful in AI/ML when performance differences are not normally distributed or contain outliers. Example: compare cross-validated accuracy of two models on the same folds and test whether one consistently outperforms the other.
Imagine you try two coffee brands on the same mornings and write down which one tastes better each day. You’re not assuming anything about “taste scores” being perfectly bell-shaped—you just want to know if one brand tends to win.
The Wilcoxon Signed-Rank Test does something similar for data: it compares two related sets of measurements from the same people or items (like “before vs. after” a change, or two models tested on the same cases). It looks at the size and direction of the differences and checks whether the typical difference is really around zero, without needing strong assumptions about the data’s shape.