EXPECTATION-MAXIMIZATION
ALGORITHM
1
EXPECTATION-MAXIMIZATION ALGORITHM
▪ Expectation–maximization (EM) algorithm is
an iterative method to find (local) maximum
likelihood or maximum a posteriori (MAP)
estimates of parameters in statistical models, where
the model depends on unobserved latent variables
2
EXPECTATION-MAXIMIZATION ALGORITHM
▪ In most of the real-life problem statements of
Machine learning, it is very common that we have
many relevant features available to build our model
but only a small portion of them are observable.
▪ Since we do not have the values for the not
observed (latent) variables, the Expectation-
Maximization algorithm tries to use the existing
data to determine the optimum values for these
variables and then finds the model parameters
https://medium.com/@clarice.wang/understanding-the-em-algorithm-by-examples-with-
code-and-visualization-dc93657adc84 3
EM ALGORITHM
▪ The EM algorithm involves two steps:
1.Expectation Step (E-step): Estimate the missing data (latent
variables) based on the observed data and current estimates of
the model parameters.
2.Maximization Step (M-step): Update the model parameters to
maximize the likelihood of the data, assuming the estimated
values from the E-step are accurate.
3.Repeat E-step and M-step until the convergence of the values
occurs.
4
EM ALGORITHM
▪ 1st Step: The very first step is to initialize the parameter values. Further, the
system is provided with incomplete observed data with the assumption that
data is obtained from a specific model.
▪ 2nd Step: This step is known as Expectation or E-Step, which is used to
estimate or guess the values of the missing or incomplete data using the
observed data. Further, E-step primarily updates the variables.
▪ 3rd Step: This step is known as Maximization or M-step, where we use
complete data obtained from the 2nd step to update the parameter values.
Further, M-step primarily updates the hypothesis.
▪ 4th step: The last step is to check if the values of latent variables are
converging or not. If it gets "yes", then stop the process; else, repeat the
process from step 2 until the convergence occurs.
5
EM ALGORITHM- FLOWCHART