<< Click to Display Table of Contents >> Navigation: Reference Manual > DSL_dataGenerator |
Header file: datagenerator.h
DSL_dataGenerator(DSL_network &net);
To create a DSL_dataGenerator instance, you need to pass a reference to DSL_network, which will be used as a source probability distribution for the data generator.
int GenerateData(DSL_dataset &ds);
Generate data and store the results in the DSL_dataset
int GenerateData(const char *filename,
const DSL_datasetWriteParams *params = NULL);
Generate data and write the results to a text file. To fine tune the output format, pass the pointer to the DSL_datasetWriteParams object.
int GenerateData(DSL_dataGeneratorOutput &out);
Generate data and write the results to an abstracted output. In order to use this method, create a class derived from DSL_dataGeneratorOutput , which is a pure abstract class declared in datagenerator.h header.
void SetNumberOfRecords(int numrec);
int GetNumberOfRecords() const;
Set/get the number of records to generate.
void SetRandSeed(int seed);
int GetRandSeed() const;
Set/get the seed used to initialize the random generator. Defaults to zero, which causes the value based on system clock to be used as seed.
void SetMissingValuePercent(int perc);
int GetMissingValuePercent() const;
Set/get the percentage of missing values. Defaults to zero.
void SetBiasSamplesByEvidence(bool bias);
bool GetBiasSamplesByEvidence() const;
If set to true, generates a data file from the posterior joint probability distribution (i.e., biased by the observations) rather than from the original joint probability distribution. Defaults to false.
int SetSelectedNodes(const std::vector<int> &selection);
const std::vector<int>& GetSelectedNodes() const;
Set/get the nodes included in the output from GenerateData. By default the selection vector is empty, which means that all nodes will be included.