Auto determine number of classes from number of cols in probability matrix.