mml_nb: A function to calculate the MML for the Naive Bayes model

Description Usage Arguments

View source: R/mml_nb.R

Description

This function calculates the total MML score of the Naive Bayes model. It is derived from the general MML87 formula, but for Naive Bayes only. The parameters used are not MML estimations but maximum likelihood estimations due to simplicity. The current version only works with binary variables. The free parameter of a variable is the first value (or level) appeared in all values (or levels) sorted by alphabetic order.

Usage

1
mml_nb(data, probSign, vars, arities, sampleSize, x, y, debug = FALSE)

Arguments

data

A given data set.

probSign

A data frame with 1 and -1, which corresponds to the 1st and 2nd level of a varaible. It is used for computing the FIM of Naive Bayes.

vars

A vector of all variables.

arities

A vector of variables arities.

sampleSize

Sample size of a given data set.

x

A vector of input variables.

y

The output variable.

debug

A boolean variable to display each part of the MML score.


kelvinyangli/mbmml documentation built on June 29, 2020, 3:12 a.m.