This is an auxiliary function to calculate the negative log likelihood of the Naive Bayes model for a single data point given mle of parameters. That is, the function returns partial value of nll, without calculating log(px). The complete value of nll is calculated in mml_nb().
1 | nll_nb(dataPoint, pars, xIndices, yIndex)
|
dataPoint |
A single data point in the given data set. |
pars |
A list of MLE of NB parameters. |
xIndices |
A vector of input variables' indices. |
yIndex |
The index of the output variable. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.