learn_dbn_structure_pso: Learn a DBN structure with a PSO approach

Description Usage Arguments Value

View source: R/pso_main.R

Description

Given a dataset and the desired Markovian order, this function returns a DBN structure ready to be fitted with the 'dbnR' package. It requires a 'folded' dataset, meaning that all variables have to be in the format 'xxxx_t_y', where 'xxxx' is the name of the variable and 'y' is the time-slice of the variable. This folding can be done manually by shifting the columns and renaming them or automatically via the 'dbnR' package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
learn_dbn_structure_pso(
  dt,
  size,
  n_inds = 50,
  n_it = 50,
  in_cte = 1,
  gb_cte = 0.5,
  lb_cte = 0.5,
  v_probs = c(10, 65, 25),
  r_probs = c(-0.5, 1.5)
)

Arguments

dt

a data.table with the data of the network to be trained. Previously folded with the 'dbnR' package or other means.

size

Number of timeslices of the DBN. Markovian order 1 equals size 2, and so on.

n_inds

Number of particles used in the algorithm.

n_it

Maximum number of iterations that the algorithm can perform.

in_cte

parameter that varies the effect of the inertia

gb_cte

parameter that varies the effect of the global best

lb_cte

parameter that varies the effect of the local best

v_probs

vector that defines the random velocity initialization probabilities

r_probs

vector that defines the range of random variation of gb_cte and lb_cte

Value

A 'dbn' object with the structure of the best network found


dkesada/PSOHO documentation built on Dec. 7, 2020, 11:35 p.m.