public class NaiveBayes.M extends UPFunctionModel.M
NaiveBayes.
pr(od|id) = pr(id&od)/pr(id) = pr(od).pr(id|od)/pr(id),
so pr(od|id) ∝ pr(od).pr(id|od);
calculate for each case of od and normalise.Model.Defaults, Model.TransformValue.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple| Modifier and Type | Field and Description |
|---|---|
Dependent.M |
dpndt_m
The "backwards" Dependent Model of (O×I), that
we are turning around, I→O; it is made of
〈O, O→I〉 and we want I→O.
|
FunctionModel |
O2I
dpndt_m's "backwards" FunctionModel of O→I. |
Discretes.Bounded.M |
Omdl
dpndt_m's Model of O. |
| Modifier and Type | Method and Description |
|---|---|
Model |
condModel(Value id)
Return a
MultiState Model of output datum od
conditional on given input datum id. |
double |
nlLH(Value ss)
Assumes
statistics 'ss'
are the data-set itself. |
asUPModel, condNl2Pr, condNlPr, condPr, nlPr, pr, random, randomasEstimator, m1m2sp, msg, msg1, msg1bits, msg2, msg2bits, msgBits, nl2LH, nl2Pr, random, randomSeries, statParams, stats, stats, sumNlPr, transform, type, zeroTrivpublic final Dependent.M dpndt_m
public final Discretes.Bounded.M Omdl
dpndt_m's Model of O.public final FunctionModel O2I
dpndt_m's "backwards" FunctionModel of O→I.public M(double msg1,
double msg2,
Value sp)
public double nlLH(Value ss)
statistics 'ss'
are the data-set itself. It all hinges on
condModel.public Model condModel(Value id)
MultiState Model of output datum od
conditional on given input datum id. Try every possible value, v,
for od, calculate joint probability pr(v&id), normalise these
probabilities, which yields pr(v|id).condModel in class FunctionModel