naive.bayes: Maximum likelihood estimates of parameters the naive Bayes...

Description Usage Arguments Details Value Author(s) Examples

Description

This is a function to estimate parameters of some variants of naive Bayes model: gaussian and multinomial.

Usage

1
  naive.bayes(x, ct)

Arguments

x

is the dataset

ct

is a string that labels the categorical variable that classifies the instances into groups

Details

This function provides maximum likelihood estimates of the naive Bayes classifier. It models qualitative features and discrete and continous quantitative features. WARNING: qualitative/discrete features must be represented by factor atomic class and the number of levels of the factor is the number of parameters of the multinomial. Moreover, it must be used atomic class numeric for the real valued features. The function allows that the user includes as input qualitative/discrete and continuous features at the same time. Gaussian distribution is used for real valued features and multinomial for qualitative/discrete features.

Value

The output is an object of class nb that contains maximum likelihood estimates of model.

par

a list with maximum likelihood estimates of parameters

est.pi

the estimates of prior probabilities of categories

ncat

number of categories

ct

is a string that labels the categorical variable that classifies the instances into group

Author(s)

Renato Rodrigues Silva, renato.rrsilva@ufg.br

Examples

1
2
3
data(seeds)
mod = naive.bayes(x=seeds, ct="varieties")
mod

renatorrsilva/nb documentation built on May 30, 2019, 6:14 p.m.