Learn R Programming

bnclassify (version 0.4.8)

tan_chowliu: 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)

Value

A bnc_dag object.

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.

References

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

Examples

Run this code
data(car)
ll <- tan_cl('class', car, score = 'loglik')   
if (FALSE) plot(ll)
ll <- tan_cl('class', car, score = 'loglik', root = 'maint')   
if (FALSE) plot(ll)
aic <- tan_cl('class', car, score = 'aic')   
bic <- tan_cl('class', car, score = 'bic')   

Run the code above in your browser using DataLab