Calculating conditional distribution on class values.