tan_chowliu {bnclassify}R Documentation

Learns a one-dependence estimator using Chow-Liu's algorithm.

Description

Learns a one-dependence Bayesian classifier using Chow-Liu's algorithm, by maximizing either log-likelihood, the AIC or BIC scores; maximizing log-likelihood corresponds to the well-known tree augmented naive Bayes (Friedman et al., 1997). When maximizing AIC or BIC the output might be a forest-augmented rather than a tree-augmented naive Bayes.

Usage

tan_cl(class, dataset, score = "loglik", root = NULL)

Arguments

class

A character. Name of the class variable.

dataset

The data frame from which to learn the classifier.

score

A character. The score to be maximized. 'loglik', 'bic', and 'aic' return the maximum likelihood, maximum BIC and maximum AIC tree/forest, respectively.

root

A character. The feature to be used as root of the augmenting tree. Only one feature can be supplied, even in case of an augmenting forest. This argument is optional.

Value

A bnc_dag object.

References

Friedman N, Geiger D and Goldszmidt M (1997). Bayesian network classifiers. Machine Learning, 29, pp. 131–163.

Examples

data(car)
ll <- tan_cl('class', car, score = 'loglik')   
## Not run: plot(ll)
ll <- tan_cl('class', car, score = 'loglik', root = 'maint')   
## Not run: plot(ll)
aic <- tan_cl('class', car, score = 'aic')   
bic <- tan_cl('class', car, score = 'bic')   

[Package bnclassify version 0.4.8 Index]