Learn R Programming

dplbnDE (version 0.1.3)

lshade: Discriminative parameter learning of BN by L-SHADE.

Description

Learn parameters of a Bayesian Network in a discriminative way by Success-History based Adaptive Differential evolution with a Linear Population Size Reduction

Usage

lshade(
  NP = 40,
  G = 100,
  data,
  class.name,
  c = 0.1,
  structure = c("nb", "tancl", "hc"),
  pB = 0.05,
  edgelist = NULL,
  verbose = 25,
  ...
)

Value

An object of class DE, which is a list with the following components:

Best

A bnc_bn object with the best individual in the final population, i.e., the bayesian network with the best fitness at the end of evolution.

BestCLL

A numeric specifying the Conditional Log-Likelihood of the best individual.

pobFinal

A list of bnc_bn objects with the final population, i.e., a set of bayesian networks with optimized parameters at the end of evolution.

CLLPobFinal

A numeric vector specifying the Conditional Log-Likelihood of the final population.

N.evals

An integer giving the total number of evaluations.

convergence

A numeric vector giving the maximum Conditional Log-Likelihood at each generation.

evaluations

An integer vector giving the total number of evaluations at each generation.

Arguments

NP

positive integer giving the number of candidate solutions in the initial population.

G

positive integer specifying the maximum number of generations that may be performed before the algorithm is halted.

data

The data frame from which to learn the classifier.

class.name

A character. Name of the class variable.

c

Numeric. An adaptation parameter. Default is 0.1.

structure

A character. Name of the structure learning function. "tan" uses Tree Augmented Network. "nb" uses Naive Bayes. "hc" uses Hill Climbing.

pB

Numeric. JADE mutation strategy.

edgelist

A matrix. An optional edge list to use a custom BN structure that will replace de learned structure.

verbose

positive integer indicating the number of generations until the iteration progress should be printed.

...

other structure learning options from tan_cl or tan_hc.

Examples

Run this code
# Load data
data(car)
# Parameter learning with "LSHADE" variant
dpl.lshade <- lshade(NP = 40, G = 50, data = car, class.name = names(car)[7], c = 0.1,
structure = "tan", pB = 0.05, edgelist = NULL, verbose = 5)
# Print results
print(dpl.lshade)
if (FALSE) plot(dpl.lshade)

Run the code above in your browser using DataLab