# Classifier from Two Distributions

Maybe this is a noob question and maybe it should be on CrossValidated ...

Suppose I have two classes {class1, class2} and have their two associated EmpiricalDistribution[]s, pdf1(x) and pdf2(x).

Then, given an x value, what is the appropriate way to classify x (i.e. calculate the probability of each class) ?

dist1 = EmpiricalDistribution[Range[11] -> Range[1, 0, -.1]];
dist2 = EmpiricalDistribution[Range[11] -> Range[0, 1, .1]];

DiscretePlot[PDF[dist1, x], {x, 0, 1, .1}]


DiscretePlot[PDF[dist2, x], {x, 0, 1, .1}]


With[{x = 0.3}, {#1, #2}/(#1 + #2) & @@ {PDF[dist1, x], PDF[dist2, x]}]


(* class1_prob, class2_prob *)

{0.666667, 0.333333}

• sure, but is this really the correct answer ? – Abel Brown Oct 19 '16 at 12:27
• @AbelBrown Why not? – Alexey Golyshev Oct 19 '16 at 15:20