Sorry to be too jargony.

Suppose you fit a classification model and treat the classes as unordered. Suppose you have four classes (`A`

though `D`

) and you get class probabilities for a data point that look like:

```
A B C D
0.10 0.35 0.20 0.35
```

Since they are ordinal, you might expect that the class probabilities should not have an up- and down-pattern and should be monotonically increasing or decreasing. You can post-process these results to fit that constraint.

A simple PAVA algorithm would find where the assumption is violated and change the data values. Here an example using the `isotone`

(pdf) package:

```
> library(isotone)
> dat <- data.frame(x = 1:4, prob = c(0.10, 0.35, 0.20, 0.35))
> gpava(dat$x, dat$prob)
Call:
gpava(z = dat$x, y = dat$prob)
PAVA results:
Predictor Fitted Values
1 1 0.10
2 2 0.28
3 3 0.28
4 4 0.35
```

The class probability values for classes `B`

and `C`

were modifed to better fit the assumptions.