Category:Bayesian Networks: Packages & Functions

Packages & Functions:
Klar and caret package, and the function used for naiveBayes are train with parameter ‘nb’,

In the package ‘e1071’, there is a function ‘naiveBayes’

In the package bnlearn, there are the function bn.cv and hc which is used for Bayesian network using cross validation with parameters to pass for K2 and Hill Climbing.

In the packages tm and snowballc, are used for stemming the words of text, tm_map to clean the text dataset.

More information about "bnlearn" package:
The bnlearn package has a number of functions for Bayes net learning such as hc, tabu, mmhc,and rsmax2. Each one takes in a dataset to train, a white list of what arcs the net should contain, and black list for what arcs shouldn’t be created along with algorithm specific parameters ( such as how many iterations should be performed, max number of parents, and the score function that should be used). There is also a predict function which takes in a Bayes net model, an attribute to classify to, and a test set and returns  an array of how each instance was classified. > model <- hc(trainData,score=SCORE,maxp=2) # hc tabu mmhc rsmax2 > testPrediction <- predict(model,node="religion",data=testData)