1
$\begingroup$

KS tells how different two distributions are from each other. Assume I have a classifier model that has completely misunderstood the data and predicts a 0 for every 1 and a 1 for every 0. Assume the probability distributions are really far apart.

Wouldn't this model have a horrible accuracy and a really good KS, since KS doesn't measure accuracy but only distribution difference? If I measure my model per KS it says I will have an excellent model when it is garbage at correctly predicting the output.

What am I not understanding in regards to using KS to evaluate classifier performance?

EDIT: I am asking because I've encountered KS as measure of model performance in online articles and professional settings

$\endgroup$
5
  • $\begingroup$ Yes, if you’re reverse-calibrated, you would miss that. Given this issue (among some others that I suspect), why use such a metric over something like log loss or Brier score? Is someone suggesting you use a KS test? $\endgroup$
    – Dave
    Commented Sep 15, 2022 at 17:44
  • $\begingroup$ Where has it been suggested to use the KS to assess classifier performance? The KS tests the hypothesis that two distributions are the same. If $X_1, X_2$ are iid $N(0,1)$ RVs, then the KS test will show no distributional difference between them, but $X_1$ doesn't predict $X_2$ at all. $\endgroup$
    – AdamO
    Commented Sep 15, 2022 at 17:46
  • $\begingroup$ @Dave I agree with your take. I encountered a process in which the test is used to asses model performance and was somewhat skeptical of it, came here to make sure I wasn't missing anything. $\endgroup$
    – PJ_
    Commented Sep 15, 2022 at 18:20
  • $\begingroup$ @AdamO quick example from an online article of KS being used to assess performance: towardsdatascience.com/… $\endgroup$
    – PJ_
    Commented Sep 15, 2022 at 18:21
  • $\begingroup$ @PeJota stop reading this stupid blog. An MS candidate in CS who simply doesn't know what he's talking about. $\endgroup$
    – AdamO
    Commented Sep 15, 2022 at 22:16

1 Answer 1

1
$\begingroup$

The Kolmogorov-Smirnoff statistic has some problems as a machine learning performance metric that are worth knowing.

First, KS only assesses the maximum vertical distance between CDFs. Consequently, it will not be sensitive to differences elsewhere that a metric like Brier score or log loss will detect. Whenever either of those metrics encounter a prediction that differs from the observed value, there is a penalty.

Second, as you have noted, the KS test misses reverse calibration. If my predictions are consistently the opposite of what they should be, there are ways to handle that, but I need to know, not be deceived into thinking my predictions are good.

A combination of a poor score on a metric that catches reverse calibration and a high score on KS (so a low p-value) could be a signal that there is reverse calibration. I suspect, however, there to be considerably better alternatives.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.