Reference Manual: DSL naiveBayes

From DSL

Jump to: navigation, search

This class implements the learning procedure for learning the naive Bayes model.

Methods

  • DSL_naiveBayes()

DSL_naiveBayes(const DSL_naiveBayesParams &params)

Constructors for the class DSL_naiveBayes. The first constructor creates the object with the default values of the parameters. DSL_naiveBayesParams is a structure that stores settings for the DSL_naiveBayes. It has the following fields and their default values:


enum PriorsType {K2, BDeu}, constants that define type of priors available.

PriorsType priors = K2, defines type of priors to use.

bool featureSelection = false, defines if feature selection algorithms should be used.

std::string classVariableId = "class", a variable id of the class node.

double netWeight = 1.0, for BDeu priors it defines weight assigned to the uniform priors.


  • int Learn(const DSL_dataset &data, DSL_network &net);

This method performs the actual learning procedure. The first argument is the input data set. The result of learning procedure is stored in the DSL_network, which is the second argument. The method returns DSL_OKAY if learning was successful and an error code otherwise.

Personal tools