public class BayesNet extends ClassificationGenerator
-h Prints this help.
-o <file> The name of the output file, otherwise the generated data is printed to stdout.
-r <name> The name of the relation.
-d Whether to print debug informations.
-S The seed for random function (default 1)
-n <num> The number of examples to generate (default 100)
-A <num> The number of arcs to use. (default 20)
-N <num> The number of attributes to generate. (default 10)
-C <num> The cardinality of the attributes and the class. (default 2)
BayesNetGenerator,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected BayesNetGenerator |
m_Generator
the bayesian net generator, that produces the actual data
|
m_NumExamplesm_CreatingRelationName, m_DatasetFormat, m_Debug, m_DefaultOutput, m_NumExamplesAct, m_OptionBlacklist, m_Output, m_Random, m_RelationName, m_Seed| Constructor and Description |
|---|
BayesNet()
initializes the generator
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
cardinalityTipText()
Returns the tip text for this property
|
protected int |
defaultCardinality()
returns the default cardinality
|
protected int |
defaultNumArcs()
returns the default number of arcs
|
protected int |
defaultNumAttributes()
returns the default number of attributes
|
Instances |
defineDataFormat()
Initializes the format for the dataset produced.
|
Instance |
generateExample()
Generates one example of the dataset.
|
Instances |
generateExamples()
Generates all examples of the dataset.
|
java.lang.String |
generateFinished()
Generates a comment string that documentats the data generator.
|
java.lang.String |
generateStart()
Generates a comment string that documentates the data generator.
|
int |
getCardinality()
Gets the cardinality of the attributes (incl class attribute)
|
protected BayesNetGenerator |
getGenerator()
returns the actual datagenerator
|
int |
getNumArcs()
Gets the number of arcs for the bayesian net
|
int |
getNumAttributes()
Gets the number of attributes that should be produced.
|
int |
getNumExamples()
Gets the number of examples, given by option.
|
java.lang.String[] |
getOptions()
Gets the current settings of the datagenerator.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Gets the random number seed.
|
boolean |
getSingleModeFlag()
Return if single mode is set for the given data generator mode depends on
option setting and or generator type.
|
java.lang.String |
globalInfo()
Returns a string describing this data generator.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for executing this class.
|
java.lang.String |
numArcsTipText()
Returns the tip text for this property
|
java.lang.String |
numAttributesTipText()
Returns the tip text for this property
|
void |
setCardinality(int value)
Sets the cardinality of the attributes (incl class attribute)
|
protected void |
setGeneratorOption(BayesNetGenerator generator,
java.lang.String option,
java.lang.String value)
sets a specific option/value of the generator (option must be w/o then '-')
|
protected void |
setGeneratorOption(java.lang.String option,
java.lang.String value)
sets a specific option/value of the generator (option must be w/o then '-')
|
protected void |
setGeneratorOptions(BayesNetGenerator generator,
java.util.Vector<java.lang.String> options)
sets the given options of the BayesNetGenerator
|
protected void |
setGeneratorOptions(java.util.Vector<java.lang.String> options)
sets the given options of the BayesNetGenerator
|
void |
setNumArcs(int value)
Sets the number of arcs for the bayesian net
|
void |
setNumAttributes(int numAttributes)
Sets the number of attributes the dataset should have.
|
void |
setNumExamples(int numExamples)
Sets the number of examples, given by option.
|
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object.
|
void |
setSeed(int newSeed)
Sets the random number seed.
|
defaultNumExamples, numExamplesTipTextaddToBlacklist, clearBlacklist, debugTipText, defaultNumExamplesAct, defaultOutput, defaultRelationName, defaultSeed, enumToVector, formatTipText, getDatasetFormat, getDebug, getEpilogue, getNumExamplesAct, getOutput, getPrologue, getRandom, getRelationName, getRelationNameToUse, isOnBlacklist, makeData, makeOptionString, numExamplesActTipText, outputTipText, randomTipText, relationNameTipText, removeBlacklist, runDataGenerator, seedTipText, setDatasetFormat, setDebug, setNumExamplesAct, setOutput, setRandom, setRelationName, toStringFormatprotected BayesNetGenerator m_Generator
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class ClassificationGeneratorpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-h Prints this help.
-o <file> The name of the output file, otherwise the generated data is printed to stdout.
-r <name> The name of the relation.
-d Whether to print debug informations.
-S The seed for random function (default 1)
-n <num> The number of examples to generate (default 100)
-A <num> The number of arcs to use. (default 20)
-N <num> The number of attributes to generate. (default 10)
-C <num> The cardinality of the attributes and the class. (default 2)
setOptions in interface OptionHandlersetOptions in class ClassificationGeneratoroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class ClassificationGeneratorDataGenerator.removeBlacklist(String[])protected void setGeneratorOptions(BayesNetGenerator generator, java.util.Vector<java.lang.String> options)
generator - the generator to set the options foroptions - the options to setprotected BayesNetGenerator getGenerator()
protected void setGeneratorOptions(java.util.Vector<java.lang.String> options)
options - the options to setprotected void setGeneratorOption(BayesNetGenerator generator, java.lang.String option, java.lang.String value)
generator - the generator to set the option foroption - the option to setvalue - the new value for the optionprotected void setGeneratorOption(java.lang.String option,
java.lang.String value)
option - the option to setvalue - the new value for the optionprotected int defaultNumAttributes()
public void setNumAttributes(int numAttributes)
numAttributes - the new number of attributespublic int getNumAttributes()
public java.lang.String numAttributesTipText()
protected int defaultCardinality()
public void setCardinality(int value)
value - the cardinalitypublic int getCardinality()
public java.lang.String cardinalityTipText()
protected int defaultNumArcs()
public void setNumArcs(int value)
value - the number of arcspublic int getNumArcs()
public java.lang.String numArcsTipText()
public void setNumExamples(int numExamples)
setNumExamples in class ClassificationGeneratornumExamples - the new number of examplespublic int getNumExamples()
getNumExamples in class ClassificationGeneratorpublic int getSeed()
getSeed in interface RandomizablegetSeed in class DataGeneratorpublic void setSeed(int newSeed)
setSeed in interface RandomizablesetSeed in class DataGeneratornewSeed - the new random number seed.public boolean getSingleModeFlag()
throws java.lang.Exception
getSingleModeFlag in class DataGeneratorjava.lang.Exception - if mode is not set yetpublic Instances defineDataFormat() throws java.lang.Exception
defineDataFormat in class DataGeneratorjava.lang.Exception - if the generating of the format failedgetSeed()public Instance generateExample() throws java.lang.Exception
generateExample in class DataGeneratorjava.lang.Exception - if the format of the dataset is not yet definedjava.lang.Exception - if the generator only works with generateExamples which
means in non single modepublic Instances generateExamples() throws java.lang.Exception
generateExamples in class DataGeneratorjava.lang.Exception - if the format of the dataset is not yet definedjava.lang.Exception - if the generator only works with generateExample, which
means in single modegetSeed()public java.lang.String generateStart()
generateStart in class DataGeneratorpublic java.lang.String generateFinished()
throws java.lang.Exception
generateFinished in class DataGeneratorjava.lang.Exception - if the generating of the documentaion failspublic java.lang.String getRevision()
public static void main(java.lang.String[] args)
args - should contain arguments for the data producer: