0
$\begingroup$

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.

$\endgroup$
  • 2
    $\begingroup$ 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.) $\endgroup$ – Glen_b Oct 12 '14 at 23:22
  • $\begingroup$ You're right, the data I was looking at was beyond corrupted, sorry. I've just edited the question with correct data and calculations. $\endgroup$ – ojosilva Oct 13 '14 at 0:16
1
$\begingroup$

It sounds like you have a distribution, and want to turn it into a point estimate. The mean is certainly one way to do this, but there are many others. To decide which method is best, you need to specify an error measure on the estimate, otherwise known as a loss function. If the error measure is squared error, then the mean is the optimal point estimate.

Your question also seems to ask if there is a better choice of distribution than putting a point mass at each of the given values. Naïve Bayes by itself doesn't specify how one should interpolate these values, so you would have to apply some density estimator. For example, a kernel density estimator or interpolation of the empirical CDF. But I don't think there is much to gain from this.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.