DSL_bs

<< Click to Display Table of Contents >>

Navigation:  Reference Manual > Learning >

DSL_bs

Header file: bs.h


DSL_bs();

The default constructor.


int Learn(const DSL_dataset &ds_, DSL_network &net, 

    DSL_progress *progress = NULL, DSL_bsEvaluator *eval = NULL, 

    double *bestScore = NULL, int *bestIteration = NULL) const;

Creates a network structure using the Bayesian Search algorithm, then learns the parameters with EM using the specified data set. Each variable in the data set is represented by a node in the network after learning is complete. Returns DSL_OKAY on success or an error code on failure.

The optional argument progress can be used to stop learning by returning false from DSL_progress::Tick method, which is called periodically within the main loop of the learning algorithm. In such case, the Learn method returns DSL_INTERRUPTED.

The optional argument eval may be used to provide an alternative structure evaluator, see DSL_bsEvaluator reference for details.

The optional output arguments bestScore and bestIteration can be used to obtain the score for the network structure selected by the algorithm and the iteration index corresponding to that network structure.


int nrIteration;

Number of iterations (restarts) to be performed in the main structure learning loop. Each iteration starts with random structure and is refined until convergence. Defaults to 20.


int maxParents;

Maximum number of parents (in-degree) in the learned network. Defaults to 5.


int maxSearchTime;

Maximum search time (in seconds) for the structure learning to run. Elapsed time is checked after each iteration is complete. Defaults to zero, which means no time limit.


int seed;

The seed used to initialize the random generator. Defaults to zero, which causes the value based on system clock to be used as seed.


int priorSampleSize;

Takes part in the score calculation, representing the inertia of the current parameters when introducing new data. Defaults to 50.


double linkProbability;

The parameter used when generating a random network at the outset of each of the iterations. It essentially influences the connectivity of the starting network. Defaults to 0.1.


double priorLinkProbability;

Influences the score, by offering a prior probability over all edges. It comes into the formula in the following way:

log Posterior score = log marginal likelihood (i.e., the BDeu) + |parents|*log(pll) + (|nodes|-|parents|-1)*log(1-pll))

Defaults to 0.001.


DSL_bkgndKnowledge bkk;

Background knowledge used to constrain the network structures created by structure learning algorithm. Empty by default.