Learn R Programming

bnclassify (version 0.4.8)

bnc: Learn network structure and parameters.

Description

A convenience function to learn the structure and parameters in a single call. Must provide the name of the structure learning algorithm function; see bnclassify for the list.

Usage

bnc(
  dag_learner,
  class,
  dataset,
  smooth,
  dag_args = NULL,
  awnb_trees = NULL,
  awnb_bootstrap = NULL,
  manb_prior = NULL,
  wanbia = NULL
)

Arguments

dag_learner

A character. Name of the structure learning function.

class

A character. Name of the class variable.

dataset

The data frame from which to learn network structure and parameters.

smooth

A numeric. The smoothing value (\(\alpha\)) for Bayesian parameter estimation. Nonnegative.

dag_args

A list. Optional additional arguments to dag_learner.

awnb_trees

An integer. The number (\(M\)) of bootstrap samples to generate.

awnb_bootstrap

A numeric. The size of the bootstrap subsample, relative to the size of dataset (given in [0,1]).

manb_prior

A numeric. The prior probability for an arc between the class and any feature.

wanbia

A logical. If TRUE, WANBIA feature weighting is performed.

Examples

Run this code
data(car)
nb <- bnc('nb', 'class', car, smooth = 1)
nb_manb <- bnc('nb', 'class', car, smooth = 1, manb_prior = 0.3)
ode_cl_aic <- bnc('tan_cl', 'class', car, smooth = 1, dag_args = list(score = 'aic'))

Run the code above in your browser using DataLab