Computes the positively oriented Brier/quadratic score. Vector probability input is treated as binary; matrix probability input is treated as categorical.
Details
For binary forecasts, this computes $$S(p, y) = -(p-y)^2.$$
For categorical forecasts, this computes
$$S(\mathbf{p}, y) = -\frac{1}{2}\|\mathbf{p} - e_y\|_2^2,$$
where e_y is the one-hot vector of the realised category.
With the convention that category 2 corresponds to the binary event
y = 1, the categorical formula recovers the binary formula exactly
when K = 2.