# Turning categorized output into continuous

I'm using a NaiveBayes algorithm that generates categorized probabilities as output instead of continuous values, which is what I need for this webapp I'm working on. Unfortunately I can't switch algorithms right now, what would be the most adequate way/formula at this point to turn the output into a single real number?

The data looks like this (Javascript object):

{
14:0.01,
15:0.02,
17:0.04,
18:0.06,
19:0.08,
20:0.04,
21:0.04,
22:0.13,
23:0.01,
24:0.09,
25:0.03,
26:0.03,
27:0.08,
28:0.01,
29:0.03,
30:0.03,
31:0.03,
33:0.05,
35:0.01,
36:0.03,
38:0.02,
39:0.01,
41:0.01,
42:0.01,
45:0.01
}


The prediction in this case should be closer to 26. But if I use the mean I get 28.04, which is not bad, but I'm quite certain there's a more sane way to calculate this without using just means given the underlying algorithm and the feeling the result is more like bell shaped.

• How do you get total probability exceeding 1 (and by a long way)? If you have 90% chance of one outcome, all other - mutually exclusive - outcomes should add to 10%, shouldn't they? (Either that or you left out something important in your question.) – Glen_b Oct 12 '14 at 23:22
• You're right, the data I was looking at was beyond corrupted, sorry. I've just edited the question with correct data and calculations. – ojosilva Oct 13 '14 at 0:16