It is a computer science problem.. More precisely this is what the problem wants to do:
Naive Bayes Classifier is a probabilistic classifier which is based on Bayes Theorem and work under the assumption of independence between the variables.
Without going into too much details of the actual problem ( since it is a database related problem and I have to use lots of jargon
We want to maximize this objective function which is based on Naive Bayes Classifier:
sum(j=1..z) [P(Tj | a1, a2......,am) ]
Applying Bayes Theorem
P(Tj | a1, a2......,am) = P(j) * mult(i=1..m)[P(ai | j)]
Therefore, the objective function is :
sum(j=1..z)[P(j) * mult(i=1..m)[P(ai | j)]]
Now, a1, a2,...,am are m boolean variables and can have values 0 or 1.
Now, let pij1 = P(ai=1 | j)
and pij0 = P(ai=0 | j)
also, pij1 + pij0 = 1
Therefore,
I rewrite the objective function as follows:
Maximize,
sum(j=1..z)[P(j) * mult(i=1..m)[ai * pij1 + (1-ai)*(pij0)]]
=sum(j=1..z)[P(j) * mult(i=1..m)[ai * pij1 + (1-ai)*(1-pij1)]]
objective function,
Maximize,
sum(j=1..z)[P(j) * mult(i=1..m)[ai * pij + (1-ai)*(1-pij)]] (just replacing pij1 with pij)
we can not consider constraints like,
a1 = 1, if p11 >1/2,
a1 = 1, if p12>1/2,
.
.
.
.
a1= 1, if p1z>1/2.
If there was no outer loop (the sum loop, which runs from 1..z), I could add constraints as you suggested and could solve the problem easily.
appreciate your time.. Thanks!