Gaussian Naive Bayes is useful when working with continuous values whose probabilities can be modeled using Gaussian distributions whose means and variances are associated with each specific class (in this case, let's suppose j=1,2, ... P):
Our goal is to estimate the mean and variance of each conditional distribution, using the maximum likelihood approach, which is quite easy, considering the mathematical nature of a Gaussian distribution. The likelihood for the whole dataset is as shown:
Now, expanding the last term, ...