### A3 P2 - calculating class-conditional probabilities

Verfasst:

**1. Jul 2013 22:57**[edit: I already came across the answer, see below]

Hi,

the assignment states the following formula for the calculation of keypoint-probabilities with laplace smoothing:

\(p(\mu_i | C_j) = \frac{\displaystyle 1+\sum_{I_m \in C_j} n(i,m)}{\displaystyle k + \sum_{t=1}^k \sum_{I_m \in C_j} n(t,m)}\)

whereas the slides (l7, p. 26) contain the following formula:

\(p(w | C) = \frac{\displaystyle 1 + \sum_{i:y_i=C} | \{t : x_{it} = w\}|}{\displaystyle m + \sum_i n_i}\)

I am only concerned about the denominator, which, as far as I get it, expresses something different in both formulas.

\(k + \sum_{t=1}^k \sum_{I_m \in C_j} n(t,m)\)

sums up the occurances of all keypoints

\(m + \sum_i n_i\)

sums up the occurances of all keypoints,

We are looking for the relative frequency of a keypoint

What am I missing?

Hi,

the assignment states the following formula for the calculation of keypoint-probabilities with laplace smoothing:

\(p(\mu_i | C_j) = \frac{\displaystyle 1+\sum_{I_m \in C_j} n(i,m)}{\displaystyle k + \sum_{t=1}^k \sum_{I_m \in C_j} n(t,m)}\)

whereas the slides (l7, p. 26) contain the following formula:

\(p(w | C) = \frac{\displaystyle 1 + \sum_{i:y_i=C} | \{t : x_{it} = w\}|}{\displaystyle m + \sum_i n_i}\)

I am only concerned about the denominator, which, as far as I get it, expresses something different in both formulas.

\(k + \sum_{t=1}^k \sum_{I_m \in C_j} n(t,m)\)

sums up the occurances of all keypoints

**in image class \(C_j\)**.\(m + \sum_i n_i\)

sums up the occurances of all keypoints,

**regardless of the images class**.We are looking for the relative frequency of a keypoint

*k*in a class*A*, which should be \(\frac{occurances\ of\ k\ in\ A}{total\ occurances\ of\ k}\), so I tend to the latter alternative.What am I missing?