Learn R Programming

bbl (version 0.1.5)

train: Train Boltzmann Bayes model

Description

Perform inference on data provided and store parameters

Usage

train(object, method = "pseudo", naive = FALSE, verbose = 1,
  fixL = FALSE, ...)

Arguments

object

Object of class bbl containing training data.

method

c('pseudo','mf') for pseudo-likelihood maximization or mean field.

naive

Naive Bayes. Equivalent to using method = 'mf' and eps = 0 in mlestimate.

verbose

Verbosity level. Relays it to mlestimate with one level lower.

fixL

Use predictor level sizes L from object@predictors. If FALSE, L is inferred from object@data. Intended for cases where this function is called from crossval.

...

Other parameters for mlestimate.

Value

object with slots h, J, and lz filled.

Details

Use data stored in bbl object as the training data, performs either pseudo or mf inference for each response group, and stores the model parameters in slots h and J. This function is a driver of mlestimate for bbl objects.

Examples

Run this code
# NOT RUN {
titanic <- freq2raw(as.data.frame(Titanic), Freq='Freq')
model <- bbl(data=titanic, y='Survived')
model <- train(model, method='pseudo')
model@h
model@J[[1]]
# }

Run the code above in your browser using DataLab