Package 'r.blip'

Title: R binding of blip (Bayesian network Learning Improved Project)
Description: Offers many approaches to score-based structure learning of Bayesian networks.
Authors: Mauro Scanagatta [aut, cre]
Maintainer: Mauro Scanagatta <[email protected]>
License: GPLv3
Version: 1.1
Built: 2026-05-27 06:34:08 UTC
Source: https://github.com/mauro-idsia/r.blip

Help Index


Bayesian Learning Package - Main function.

Description

Used by most of the functions in the r.blip binding, provides access to the included jar file.

Usage

blip(args)

Arguments

args

Vector of arguments to be passed to the jar

Details

The arguments vector is formatted in a system call to the included jar file. Should not be called directly by the user, unless you know exactly what you are doing. In that case, call directly the blip jar.


Learns a BN

Description

Fully learns a Bayesian networks.

Usage

blip.learn(dat, scorer.method = "is", solver.method = "winasobs",
  indeg = 6, time = 3600, allocated = 80, scorefunction = "bic",
  alpha = 1, cores = 1, verbose = 0)

Arguments

dat

dataframe from which to learn the parent sets.(required)

scorer.method

Method to be used for scoring the parent sets. Possible values: "is" (independence selection), "sq" (sequential selection). (default: is)

solver.method

Method to be used for structure exploration. Possible values: "winasobs", "winobs", "asobs", "obs". (default: winasobs)

indeg

Maximum number of parents (default: 6)

time

Execution time (default: 3600)

allocated

Percentage of the total execution time dedicated to parent set exploration (default: 80)

scorefunction

Chosen score function. Possible choices: BIC, BDeu (default: bic)

alpha

(if BDeu is chosen) equivalent sample size parameter (default: 1.0)

cores

Number of machine cores to use. If 0, all are used. (default: 1)

verbose

Verbose level (default: 0)

Details

The input data is required to be complete and discrete. Accordingly missing values in the input data.frame will be ignored, and all numeric values will be converted to integers.

Value

The learned Bayesian network in the bnlearn format.

Examples

bn <- blip.learn(read.table('data/child-5000.dat', sep = ' '), time = 10)

Learns a BN with a treewidth bound

Description

Fully learns a Bayesian networks with a treewidth bound.

Usage

blip.learn.tw(dat, scorer.method = "is", solver.method = "kmax",
  treewidth = 4, time = 3600, allocated = 80,
  scorefunction = "bic", alpha = 1, cores = 1, verbose = 0)

Arguments

dat

dataframe from which to learn the parent sets.(required)

scorer.method

Method to be used for scoring the parent sets. Possible values: "is" (independence selection), "sq" (sequential selection). (default: is)

solver.method

Method to be used for bounded-treewidth structure exploration. Possible values: "kmax", "kg", "ka". (default: kmax)

treewidth

Maximum treewidth (default: 4)

time

Execution time (default: 3600)

allocated

Percentage of the total execution time dedicated to parent set exploration (default: 80)

scorefunction

Chosen score function. Possible choices: BIC, BDeu (default: bic)

alpha

(if BDeu is chosen) equivalent sample size parameter (default: 1.0)

cores

Number of machine cores to use. If 0, all are used. (default: 1)

verbose

Verbose level (default: 0)

Details

The input data is required to be complete and discrete. Accordingly missing values in the input data.frame will be ignored, and all numeric values will be converted to integers.

Value

The learned Bayesian network in the bnlearn format.


Parent set exploration

Description

Generates the cache of parent sets from a given data source

Usage

blip.scorer(dat, method = "is", indeg = 6, time = 3600,
  scorefunction = "bic", alpha = 1, cores = 1, verbose = 1)

Arguments

dat

dataframe from which to learn the parent sets.(required)

method

Method to be used. Possible values: "is" (independence selection), "sq" (sequential selection). (default: is)

indeg

Maximum number of parents (default: 6)

time

Maximum Execution time (default: 3600)

scorefunction

Chosen score function. Possible choices: BIC, BDeu (default: bic)

alpha

(if BDeu is chosen) equivalent sample size parameter (default: 1.0)

cores

Number of machine cores to use. If 0, all are used. (default: 1)

verbose

Verbose level (default: 0)

Details

Usually the first step in the learning of a Bayesian network.

The input data is required to be complete and discrete. Accordingly missing values in the input data.frame will be ignored, and all numeric values will be converted to integers.

Value

Cache of parent sets


Structure Optimization

Description

Find an optimal structure from the cache of parent sets

Usage

blip.solver(jkl, method = "winasobs", time = 3600, cores = 1,
  verbose = 1)

Arguments

jkl

cache of pre-computed parent sets.(required)

method

Method to be used. Possible values: "winasobs", "winobs", "asobs", "obs". (default: winasobs)

time

Maximum Execution time (default: 3600)

cores

Number of machine cores to use. If 0, all are used. (default: 1)

verbose

Verbose level (default: 0)

Details

The input data is required to be complete and discrete. Accordingly missing values in the input data.frame will be ignored, and all numeric values will be converted to integers.

Value

Structure


Structure Optimization - treewidth bound

Description

Find an optimal structure from the cache of parent sets

Usage

blip.solver.tw(jkl, method = "kmax", treewidth = 4, time = 3600,
  cores = 1, verbose = 1)

Arguments

jkl

cache of pre-computed parent sets.(required)

method

Method to be used. Possible values: "kmax", "kg", "ka". (default: kmax)

treewidth

Maximum treewidth (default: 4)

time

Maximum Execution time (default: 3600)

cores

Number of machine cores to use. If 0, all are used. (default: 1)

verbose

Verbose level (default: 0)

Details

The input data is required to be complete and discrete. Accordingly missing values in the input data.frame will be ignored, and all numeric values will be converted to integers.

Value

Structure


Read a Jkl file (parent sets cache)

Description

Read a Jkl file (parent sets cache)

Usage

read.jkl(path, data)

Read a res file for bnlearn loading

Description

Read a res file for bnlearn loading

Usage

read.str(path, data)

Write a Jkl file (parent sets cache)

Description

Write a Jkl file (parent sets cache)

Usage

write.jkl(path, jkl, data)