<< Click to Display Table of Contents >> Navigation: Reference Manual > Learning > DSL_tan |
Header file: tan.h
DSL_tan();
The default constructor.
int Learn(DSL_dataset &ds, DSL_network &net,
DSL_progress *progress = NULL,
double *emLogLik = NULL) const;
Creates a network structure using the Tree Augmented Naive Bayes (TAN) algorithm, then learns the parameters with EM from 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 algorithm produces an acyclic directed graph with the class variable being the parent of all the other (feature) variables and additional connections between the feature variables.
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 a case, the Learn method returns DSL_INTERRUPTED.
std::string classvar;
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.
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, meaning no time limit.
int seed;
The seed used to initialize the random generator. Defaults to zero, which causes a value based on the system clock to be used as seed.