DSL_nb

<< Click to Display Table of Contents >>

Navigation:  Reference Manual > Learning >

DSL_nb

Header file: nb.h


DSL_nb();

The default constructor.


int Learn(DSL_dataset ds, DSL_network &net,

    DSL_progress *progress = NULL,

    double *emLogLikelihood = NULL) const;

Creates a naive Bayes network, then learns its parameters with EM using the specified data set. Returns DSL_OKAY on success or an error code on failure.

The structure of the Naive Bayes network is not learned but rather fixed by assumption: the class variable is the only parent of all remaining, feature variables and there are no other connections between the nodes of the network.

The optional argument progress can be used to stop the 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.


std::string classVariableId;

Identifier of the class variable. If the class variable identifier is not specified or there is no variable with the specified identifier in the data set, the Learn method fails.