title: Naive Bayes Classifier, Explain model fitting and prediction algorithms
body: <p>I have the two equations below that relate to the model fitting and prediction algorithms of a naive bayes classifier. </p>
  
  <ul>
  <li><p>I am trying to understand what line 6 of algorithm 3.2 is doing. I think it is trying to make the numbers "nicer" by doing the log-sum-exp trick, which I still don't understand fully. Could someone outline why this is/needs to be done? And specifically what the argument to the <pre>logsumexp(L<sub>i,:</sub>)</pre> means/is/reads as?</p></li>
  <li><p>Also could someone give me a good notion of what the two values in line 8 of algorithm 3.1 is for? Are they basically initial offsets/biases to the <code>Lic</code> in algorithm 3.2?</p></li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/wAetN.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/3Xwjl.png" alt="enter image description here"></p>
  
  <p>From Machine Learning A Probabilistic Prospective Author Kevin P. Murphy</p>