Kendall Tau
Kendall Tau is a way to describe how similarly two things are ordered. If you rank houses by price and also rank them by size, Kendall Tau tells you whether those two rankings tend to agree.
What it measures
Kendall Tau (often written as τ) is a rank correlation: it measures association based on the relative ordering of values, not their exact numeric distances. It looks at all pairs of observations and counts how often the two variables “move together” in rank.
- A pair is concordant if the order matches (if A > B on X, then A > B on Y).
- A pair is discordant if the order disagrees.
In the simplest case (no ties), τ = (C − D) / (C + D), where C is the number of concordant pairs and D is the number of discordant pairs. Values range from −1 (perfectly reversed ranking) to +1 (perfect agreement), with 0 meaning no consistent ordering relationship.
Why it’s useful (especially with messy data)
Because it uses ranks, Kendall Tau is more robust when:
- Relationships are monotonic but not linear (consistently increasing, but not at a constant rate).
- Data have outliers (one extreme sale price won’t dominate the result).
- You care about ordering more than exact values (recommendation rankings, search results).
Where it shows up in AI/ML
Kendall Tau is common in learning-to-rank and evaluation of ranking models: compare predicted rankings vs. true rankings (e.g., which products a user prefers). It’s also used in feature analysis when variables are ordinal (survey ratings, risk categories). In practice you’ll see it in SciPy as scipy.stats.kendalltau, with variants (like τ-b) that handle ties.
Kendall Tau is a rank-based correlation coefficient that measures the strength and direction of a monotonic relationship by comparing the number of concordant vs. discordant pairs of observations. It is robust to outliers and appropriate for ordinal data or non-linear but monotonic trends, making it useful in ML for evaluating ranking quality. Example: assessing agreement between a model’s predicted item ranking and human preference rankings.
Imagine you and a friend both rank your top 10 movies. If your lists mostly agree on which movies should be higher or lower, your rankings “move together.” Kendall Tau is a way to measure how similar two rankings are.
It works by looking at pairs of items and checking whether the two rankings put each pair in the same order (agreement) or opposite order (disagreement). A value near 1 means strong agreement, near -1 means strong disagreement, and around 0 means no clear relationship.
In AI and machine learning, it’s often used to judge how well a model’s predicted ranking matches the true ranking.