If the CDF for the score (positive/negative cases) are reversed, the ks_stat will gives 0 instead of the absolute max.
This will happen when the predictor is worst than random guess, so that the positive probability distribution for 1 (positive) is actually smaller than that for 0. And thus, the difference column in the table are all non-positive cases, and thus the ks_stat calculate the max of that column, instead of the max(abs()) of that column.
If the CDF for the score (positive/negative cases) are reversed, the ks_stat will gives 0 instead of the absolute max.
This will happen when the predictor is worst than random guess, so that the positive probability distribution for 1 (positive) is actually smaller than that for 0. And thus, the difference column in the table are all non-positive cases, and thus the ks_stat calculate the max of that column, instead of the max(abs()) of that column.