Additional remarks, may be you already know :) `pi` is commonly used in all mixture models (the Naive Bayes classifier is one kind of mixture model), and the calculation formula for `pi` is the same in all mixture models.