Learn R Programming

bbl (version 0.1.5)

bbl-class: Class bbl for Boltzmann Bayes Learner

Description

Class bbl for Boltzmann Bayes Learner

Usage

# S4 method for bbl
show(object)

# S4 method for bbl [(x, i, j, remove.const = TRUE)

Arguments

object

Object of class bbl to display

x

Object of class bbl to be subsetted

i

Row index to keep

j

Not used.

remove.const

Remove predictor levels not found in data.

Methods (by generic)

  • show: Display bbl object content

    Show predictor levels, response groups, and sample size.

  • [: Subsetting of bbl object along rows (sample index)

Slots

predictors

List of vectors of characters, each corresponding to predictor factor levels.

groups

Vector of characters for response factor levels.

data

Data frame for training data. Expected to contain both predictors and response.

y

Character column name of response data in data.

h

Bias parameters stored after training. List of length equal to no. of response groups, each of which is a list of length equal to no. of predictors, containing vectors of length equal to each predictor factor levels: \(h_i^{(y)}(x)\) represented by h[[y]][[i]][x].

J

Interaction parameters stored after training. List of length equal to no. of response groups, each of which is a list of lists of dimension \(m \times m\), where \(m\) is the number of predictors. Each element is a matrix of dimension \(L_i \times L_j\), where \(L_i\) and \(L_j\) are numbers of factor levels in predictor i and j: \(J_{ij}^{(y)}(x_1,x_2)\) represented by J[[y]][[i]][[j]][x1,x2].

lz

Slot used to store log partition function of response groups.

Examples

Run this code
# NOT RUN {
data <- data.frame(y=c('g1','g2','g2','g1','g1','g2'),
  x1=c(0,0,1,2,0,1), x2=c('a','a','b','a','b','b'))
x <- bbl(data)
x
x[1:3,]
# }

Run the code above in your browser using DataLab