Probability for text classification

40 Views Asked by At

I have a list of sentences and each sentence is classified with a number of emotions ex:

I loved the movie Happiness $= 1$ Disappointment $= 0$

I hated the move Happiness $= 0$ Disappointment $= 1$

A great movie, Good movie Happiness $= 1$ Disappointment $= 0$

Poor acting Happiness $= 0$ Disappointment $= 1$

Great acting but poor story line Happiness $= 1$ Disappointment $= 1$

I already found the probability for each of these:

$$P(\text{Happiness}) = \frac{3}{5}$$

$$P(\text{Not Happiness}) = \frac{2}{5}$$

$$P(\text{Dis}) = \frac{3}{5}$$

$$P(\text{Not Dis}) = \frac{2}{5}$$

Now I would like to try to find:

1) $P(\text{Hap|Dis})$

2) $P(\text{Hap|Not Dis})$

3) $P(\text{Not Hap | Dis})$

4) $P(\text{Not Hap | Not Dis})$

I calculated the prob of the above manually as:

1) $\frac{1}{5}$

2) $\frac{2}{5}$

3) $\frac{2}{5}$

4) $\frac{0}{5}$

I guess if I need to find $$P(\text{Hap|Dis}) = \frac{P(\text{Dis|Hap}) \cdot P(\text{Hap})}{ P(\text{Dis})}$$

I know that $$P(A|B) = \frac{P(A \cap B)}{P(B)}$$

so $$P(\text{Hap|Dis}) = \frac{P(\text{Hap } \cap \text{ Dis})}{P(\text{Dis})}$$ and that $$P(A \cap B) = P(A)\cdot P(B)$$

so $$P(\text{Hap|Dis}) = \frac{P(\text{Hap})\cdot P(\text{Dis})}{P(\text{Dis})}$$

So $$P(\text{Hap|Dis}) = \frac{\frac{3}{5} \cdot \frac{3}{5}}{\frac{3}{5}}$$ Why is the answer not $\frac{1}{5}$? Am I missing something pls?

1

There are 1 best solutions below

0
On

The problem here is -

Consider the expression

$$P(A∩B)=P(A)⋅P(B)$$

This is valid when $A$ and $B$ are independent events, which clearly is not the case here.

Hope this answered your question.