CS247 – (Solution)

$ 20.99
Category:

Description

Answer1
To compute P z 1|w, d1 for all words in d1 , need to use the E-step of the
Expectation-Maximization (EM) algorithm in Probabilistic Latent Semantic Analysis (PLSA). In the E-step, we calculate the posterior probability of the latent variable z given the observed variables w and d_1. Given the initialized values:
𝜃011 0.3
𝜃021 0.4
𝛽01 1,0,0,0 𝛽02 0,0.4,0.3,0.3
Let’s calculate P z 1|w, d1 for each word in d1:
ForwordA:
P z 1|w A, d1 = (P(w = A | z = 1) * P(z = 1 | d1) / P(w = A | d1)
P(w = A | z = 1) =𝛽011 = 1
P(z = 1 | d1) = 𝜃011 = 0.3
To calculate P(w = A | d1), we use the law of total probability:
P(w = A | d1) = P(w = A, z = 1 | d1) + P(w = A, z = 2 | d1)
= P(w = A | z = 1) * P(z = 1 | d1) + P(w = A | z = 2) * P(z = 2 | d1)
= 𝛽011 * 𝜃011 + 𝛽012 ** 𝜃021
Substituting the values, we get:
P(w = A | d) = 1 * 0.3 + 0 * 0.4 = 0.3
Now we can calculate P(z = 1 | w = A, d1):
P(z = 1 | w = A, d1) = (1 * 0.3) / 0.3 = 1 Forword B:
P(z = 1 | w = B, d1) = (P(w = B | z = 1) * P(z = 1 | d1)) / P(w = B | d1)
P(w = B | z = 1) =𝛽021 = 0
P(z = 1 | d1) =𝜃011 = 0.3
P(w = B | d1) = 𝛽021 * 𝜃011 +𝛽022 * 𝜃021 = 0 * 0.3 + 0.4 * 0.4 = 0.16
P(z = 1 | w = B, d1) = (0 * 0.3) / 0.16 = 0 Forword C:
P(z = 1 | w = C, d1) = (P(w = C | z = 1) * P(z = 1 | d1)) / P(w = C | d1)
P(w = C | z = 1) =𝛽031 = 0
P(z = 1 | d1) = 𝜃011 = 0.3
P(w = C | d1) = 𝛽310 *𝜃110 + 𝛽320* 𝜃021 = 0 * 0.3 + 0.3 * 0.4 = 0.12
P(z = 1 | w = C, d1) = (0 * 0.3) / 0.12 = 0 Forword D:
P(z = 1 | w = D, d1) = (P(w = D | z = 1) * P(z = 1 | d1)) / P(w = D | d1)
P(w = D | z = 1) = 𝛽041 = 0
P(z = 1 | d_1) = 𝜃011 = 0.3 Apologies for the abrupt interruption. To continue the
calculation:
P(w = D | d1) = 𝛽041 * 𝜃011 +𝛽042 * 𝜃021 = 0 * 0.3 + 0.3 * 0.4 = 0.12
P(z = 1 | w = D, d1) = (0 * 0.3) / 0.12 = 0
Therefore, the values of P(z = 1 | w, d1) for all words in d1 are as follows:
P(z = 1 | w = A, d1) = 1
P(z = 1 | w = B, d1) = 0
P(z = 1 | w = C, d1) = 0
P(z = 1 | w = D, d1) = 0
Answer2
Update the values of β11, β12, θ11, and θ12 as follows:
Update β11:
β11 = (sum over d1 of P(z = 1 | w, d2) * count of word w in d2) divided by (sum over d1 of P(z = 1 | w, d2) * total word count in d2) Using the values from the E-step:
P(z = 1 | w = A, d2) = 1
P(z = 1 | w = B, d2) = 0
P(z = 1 | w = C, d2) = 0
P(z = 1 | w = D, d2) = 0
Count of A in d1 = 4
Total word count in d2 = 4 + 3 + 2 + 1 = 10 β11 = (1 * 4) / (1 * 10) = 0.4
Update β12:
Since β12 represents the probability of word w given topic z = 2, we need to calculate P(z = 2 | w, d2) for all words in d1:
P(z = 2 | w = A, d2) = 1 – P(z = 1 | w = A, d2) = 1 – 1 = 0
P(z = 2 | w = B, d2) = 1 – P(z = 1 | w = B, d2) = 1 – 0 = 1
P(z = 2 | w = C, d2) = 1 – P(z = 1 | w = C, d2) = 1 – 0 = 1
P(z = 2 | w = D, d2) = 1 – P(z = 1 | w = D, d2) = 1 – 0 = 1
Using these values, we can update β12 using a similar formula as for β11:
Count of B in d2 = 3
Count of C in d2 = 2 Count of D in d2 = 1 β12 = ((1 * 3) + (1 * 2) + (1 * 1)) / (1 * 10) = 0.6
Update θ11:
θ11 = (sum over d1 of P(z = 1 | w, d2) * count of topic z in d2) divided by (sum over d2 of count of topic z in d2) Count of z = 1 in d2 = 4 θ11 = (1 * 4) / (4) = 1
Update θ12:
Since θ12 represents the probability of topic z = 2 in document d2, calculate it as: θ12 = 1 – θ11 = 1 – 1 = 0
Therefore, the new values of the parameters are:
β11 = 0.4
β12 = 0.6 θ11 = 1 θ12 = 0

Answer1
In the E-step of the Expectation-Maximization (EM) algorithm for soft document clustering under a multinomial mixture model, we compute the posterior probabilities of the cluster assignments given the current parameter estimates. To derive the formula for computing the posterior probability P zi k|xi; β, π for each document i and cluster k, make use of Bayes’ theorem.
Bayes’ theorem states:
P(A | B) = (P(B | A) * P(A)) / P(B),
where P(A | B) is the posterior probability of event A given event B, P(B | A) is the likelihood of event B given event A, P(A) is the prior probability of event A, and P(B) is the probability of event B.
In our case, we want to compute the posterior probability P zi k|xi; β, π , which represents the probability that document i belongs to cluster k given its feature vector xi and the current parameter estimates β and π.
Using Bayes’ theorem, we can write:
P zi k|xi; β, π P xi|zi k; β, π ∗ P zi k; β, π/ P xi; β, π
Where P xi|zi k; β, π is the likelihood of observing feature vector xi given that document i belongs to cluster k, P zi k; β, πis the prior probability of document i belonging to cluster k, and P xi; β, π is the probability of observing feature vector xi.
The likelihood P xi|zi k; β, πcan be obtained from the multinomial distribution:
P xi|zi k; β, π=Multinomial(xi;βk )
where MultiMultinomial( xi ; βk )esents the probability mass function of the multinomial distribution with parameters β_k, βkch is the word distribution of cluster k.
The prior probabilityP zi k; β, πcan be computed as:
P zi k; β, ππk
where πk is the mixing proportion or weight associated with cluster k.
The probability of observing feature vector xi can be written as:
P xik; β, π P xi| zi k; β, π ∗ P zi k; β, π
k
which represents the sum of the likelihoods weighted by the prior probabilities over all clusters.
Putting it all together, the formula for the posterior probability P zi k; β, πis
P zi k|xi; β, π Multinomial xi; βk∗πk/ Multinomial xi; βk∗ πk
k
Answer2
In the M-step of the Expectation-Maximization (EM) algorithm for soft document clustering under a multinomial mixture model, we re-estimate the parameters βk and π based on the new posterior probabilities obtained from the E-step. The update rules for the parameters are as follows:
Updating the word distribution parameters βk:
The word distribution parameters β_k represent the probabilities of each word in the vocabulary for cluster k. To update these parameters, we can use the weighted maximum likelihood estimator, where the weights are the posterior probabilities from the E-step.
The update rule for βk is given by:
βk wik ∗ xi/ wijxi
i i j
Where wik represents the posterior probability of document i belonging to cluster k obtained from the E-step, and xi is the feature vector of document i. The summation is over all documents i and all words j in the vocabulary.
Updating the mixing proportions π:
The mixing proportions π represent the probabilities of each cluster in the mixture. To update these proportions, we can compute the average of the posterior probabilities for each cluster.
The update rule for 𝜋𝑘 is given by:
𝜋𝑘 ∑𝑖 𝑤𝑖𝑘 /𝑁
where 𝑤𝑖𝑘 represents the posterior probability of document i belonging to cluster k obtained from the E-step, and N is the total number of documents.
After updating the parameters 𝛽𝑘 and π in the M-step, we repeat the E-step and M-step iteratively until convergence, where the convergence criteria can be based on changes in the log-likelihood or the parameters.
These update rules for the parameters𝛽𝑘 and π ensure that the model parameters are iteratively refined based on the updated assignments of documents to clusters, leading to a better fit of the multinomial mixture model to the data.

Reviews

There are no reviews yet.

Be the first to review “CS247 – (Solution)”

Your email address will not be published. Required fields are marked *