public class RDG1 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 attributes (default 10).
-c <num> The number of classes (default 2)
-R <num> maximum size for rules (default 10)
-M <num> minimum size for rules (default 1)
-I <num> number of irrelevant attributes (default 0)
-N number of numeric attributes (default 0)
-V switch on voting (default is no voting)Following an example of a generated dataset:
% % weka.datagenerators.RDG1 -r expl -a 2 -c 3 -n 4 -N 1 -I 0 -M 2 -R 10 -S 2 % relation expl attribute a0 {false,true} attribute a1 numeric attribute class {c0,c1,c2} data true,0.496823,c0 false,0.743158,c1 false,0.408285,c1 false,0.993687,c2 % % Number of attributes chosen as irrelevant = 0 % % DECISIONLIST (number of rules = 3): % RULE 0: c0 := a1 < 0.986, a0 % RULE 1: c1 := a1 < 0.95, not(a0) % RULE 2: c2 := not(a0), a1 >= 0.562
Constructor and Description |
---|
RDG1()
initializes the generator with default values
|
Modifier and Type | Method and Description |
---|---|
String |
attList_IrrTipText()
Returns the tip text for this property
|
Instances |
defineDataFormat()
Initializes the format for the dataset produced.
|
Instance |
generateExample()
Generate an example of the dataset dataset.
|
Instances |
generateExamples()
Generate all examples of the dataset.
|
Instances |
generateExamples(int num,
Random random,
Instances format)
Generate all examples of the dataset.
|
String |
generateFinished()
Compiles documentation about the data generation.
|
String |
generateStart()
Generates a comment string that documentates the data generator.
|
boolean[] |
getAttList_Irr()
Gets the array that defines which of the attributes
are seen to be irrelevant.
|
int |
getMaxRuleSize()
Gets the maximum number of tests in rules.
|
int |
getMinRuleSize()
Gets the minimum number of tests in rules.
|
int |
getNumAttributes()
Gets the number of attributes that should be produced.
|
int |
getNumClasses()
Gets the number of classes the dataset should have.
|
int |
getNumIrrelevant()
Gets the number of irrelevant attributes.
|
int |
getNumNumeric()
Gets the number of numerical attributes.
|
String[] |
getOptions()
Gets the current settings of the datagenerator RDG1.
|
String |
getRevision()
Returns the revision string.
|
boolean |
getSingleModeFlag()
Gets the single mode flag.
|
boolean |
getVoteFlag()
Gets the vote flag.
|
String |
globalInfo()
Returns a string describing this data generator.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for testing this class.
|
String |
maxRuleSizeTipText()
Returns the tip text for this property
|
String |
minRuleSizeTipText()
Returns the tip text for this property
|
String |
numAttributesTipText()
Returns the tip text for this property
|
String |
numClassesTipText()
Returns the tip text for this property
|
String |
numIrrelevantTipText()
Returns the tip text for this property
|
String |
numNumericTipText()
Returns the tip text for this property
|
void |
setAttList_Irr(boolean[] newAttList_Irr)
Sets the array that defines which of the attributes
are seen to be irrelevant.
|
void |
setMaxRuleSize(int newMaxRuleSize)
Sets the maximum number of tests in rules.
|
void |
setMinRuleSize(int newMinRuleSize)
Sets the minimum number of tests in rules.
|
void |
setNumAttributes(int numAttributes)
Sets the number of attributes the dataset should have.
|
void |
setNumClasses(int numClasses)
Sets the number of classes the dataset should have.
|
void |
setNumIrrelevant(int newNumIrrelevant)
Sets the number of irrelevant attributes.
|
void |
setNumNumeric(int newNumNumeric)
Sets the number of numerical attributes.
|
void |
setOptions(String[] options)
Parses a list of options for this object.
|
void |
setVoteFlag(boolean newVoteFlag)
Sets the vote flag.
|
String |
voteFlagTipText()
Returns the tip text for this property
|
getNumExamples, numExamplesTipText, setNumExamples
debugTipText, defaultOutput, formatTipText, getDatasetFormat, getDebug, getNumExamplesAct, getOutput, getRandom, getRelationName, getSeed, makeData, outputTipText, randomTipText, relationNameTipText, seedTipText, setDatasetFormat, setDebug, setOutput, setRandom, setRelationName, setSeed
public String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class ClassificationGenerator
public void setOptions(String[] options) throws 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 attributes (default 10).
-c <num> The number of classes (default 2)
-R <num> maximum size for rules (default 10)
-M <num> minimum size for rules (default 1)
-I <num> number of irrelevant attributes (default 0)
-N number of numeric attributes (default 0)
-V switch on voting (default is no voting)
setOptions
in interface OptionHandler
setOptions
in class ClassificationGenerator
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class ClassificationGenerator
DataGenerator.removeBlacklist(String[])
public void setNumAttributes(int numAttributes)
numAttributes
- the new number of attributespublic int getNumAttributes()
public String numAttributesTipText()
public void setNumClasses(int numClasses)
numClasses
- the new number of classespublic int getNumClasses()
public String numClassesTipText()
public int getMaxRuleSize()
public void setMaxRuleSize(int newMaxRuleSize)
newMaxRuleSize
- new maximum number of tests allowed in rules.public String maxRuleSizeTipText()
public int getMinRuleSize()
public void setMinRuleSize(int newMinRuleSize)
newMinRuleSize
- new minimum number of test in rules.public String minRuleSizeTipText()
public int getNumIrrelevant()
public void setNumIrrelevant(int newNumIrrelevant)
newNumIrrelevant
- the number of irrelevant attributes.public String numIrrelevantTipText()
public int getNumNumeric()
public void setNumNumeric(int newNumNumeric)
newNumNumeric
- the number of numerical attributes.public String numNumericTipText()
public boolean getVoteFlag()
public void setVoteFlag(boolean newVoteFlag)
newVoteFlag
- boolean with the new setting of the vote flag.public String voteFlagTipText()
public boolean getSingleModeFlag()
getSingleModeFlag
in class DataGenerator
public boolean[] getAttList_Irr()
public void setAttList_Irr(boolean[] newAttList_Irr)
newAttList_Irr
- array that defines the irrelevant attributes.public String attList_IrrTipText()
public Instances defineDataFormat() throws Exception
defineDataFormat
in class DataGenerator
Exception
- data format could not be definedDataGenerator.defaultRelationName()
public Instance generateExample() throws Exception
generateExample
in class DataGenerator
Exception
- if format not defined or generating public Instances generateExamples() throws Exception
generateExamples
in class DataGenerator
Exception
- if format not defined or generating public Instances generateExamples(int num, Random random, Instances format) throws Exception
num
- the number of examples to generaterandom
- the random number generator to useformat
- the dataset formatException
- if format not defined or generating public String generateStart()
generateStart
in class DataGenerator
public String generateFinished() throws Exception
generateFinished
in class DataGenerator
Exception
- no input structure has been definedpublic String getRevision()
public static void main(String[] args)
args
- should contain arguments for the data producer:Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.