Class LED24
- java.lang.Object
-
- weka.datagenerators.DataGenerator
-
- weka.datagenerators.ClassificationGenerator
-
- weka.datagenerators.classifiers.classification.LED24
-
- All Implemented Interfaces:
java.io.Serializable
,OptionHandler
,Randomizable
,RevisionHandler
,TechnicalInformationHandler
public class LED24 extends ClassificationGenerator implements TechnicalInformationHandler
This generator produces data for a display with 7 LEDs. The original output consists of 10 concepts and 7 boolean attributes. Here, in addition to the 7 necessary boolean attributes, 17 other, irrelevant boolean attributes with random values are added to make it harder. By default 10 percent of noise are added to the data.
More information can be found here:
L. Breiman J.H. Friedman R.A. Olshen, C.J. Stone (1984). Classification and Regression Trees. Belmont, California. URL http://www.ics.uci.edu/~mlearn/databases/led-display-creator/. Link:
http://www.ics.uci.edu/~mlearn/databases/led-display-creator/ BibTeX:@inbook{Olshen1984, address = {Belmont, California}, author = {L. Breiman J.H. Friedman R.A. Olshen and C.J. Stone}, pages = {43-49}, publisher = {Wadsworth International Group}, title = {Classification and Regression Trees}, year = {1984}, ISBN = {0412048418}, URL = {http://www.ics.uci.edu/\~mlearn/databases/led-display-creator/} }
Valid options are:-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)
-N <num> The noise percentage. (default 10.0)
- Version:
- $Revision: 1.6 $
- Author:
- Richard Kirkby (rkirkby at cs dot waikato dot ac dot nz), FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LED24()
initializes the generator with default values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.double
getNoisePercent()
Gets the noise percentage.java.lang.String[]
getOptions()
Gets the current settings of the datagenerator.java.lang.String
getRevision()
Returns the revision string.boolean
getSingleModeFlag()
Return if single mode is set for the given data generator mode depends on option setting and or generator type.TechnicalInformation
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.java.lang.String
globalInfo()
Returns a string describing this data generator.java.util.Enumeration
listOptions()
Returns an enumeration describing the available options.static void
main(java.lang.String[] args)
Main method for executing this class.java.lang.String
noisePercentTipText()
Returns the tip text for this propertyvoid
setNoisePercent(double value)
Sets the noise percentage.void
setOptions(java.lang.String[] options)
Parses a list of options for this object.-
Methods inherited from class weka.datagenerators.ClassificationGenerator
getNumExamples, numExamplesTipText, setNumExamples
-
Methods inherited from class weka.datagenerators.DataGenerator
debugTipText, defaultOutput, formatTipText, getDatasetFormat, getDebug, getNumExamplesAct, getOutput, getRandom, getRelationName, getSeed, makeData, outputTipText, randomTipText, relationNameTipText, seedTipText, setDatasetFormat, setDebug, setOutput, setRandom, setRelationName, setSeed
-
-
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this data generator.- Returns:
- a description of the data generator suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the technical information about this class
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Overrides:
listOptions
in classClassificationGenerator
- Returns:
- an enumeration of all the available options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Parses a list of options for this object. Valid options are:-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)
-N <num> The noise percentage. (default 10.0)
- Specified by:
setOptions
in interfaceOptionHandler
- Overrides:
setOptions
in classClassificationGenerator
- Parameters:
options
- the list of options as an array of strings- Throws:
java.lang.Exception
- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the datagenerator.- Specified by:
getOptions
in interfaceOptionHandler
- Overrides:
getOptions
in classClassificationGenerator
- Returns:
- an array of strings suitable for passing to setOptions
- See Also:
DataGenerator.removeBlacklist(String[])
-
getNoisePercent
public double getNoisePercent()
Gets the noise percentage.- Returns:
- the noise percentage.
-
setNoisePercent
public void setNoisePercent(double value)
Sets the noise percentage.- Parameters:
value
- the noise percentage.
-
noisePercentTipText
public java.lang.String noisePercentTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSingleModeFlag
public boolean getSingleModeFlag() throws java.lang.Exception
Return if single mode is set for the given data generator mode depends on option setting and or generator type.- Specified by:
getSingleModeFlag
in classDataGenerator
- Returns:
- single mode flag
- Throws:
java.lang.Exception
- if mode is not set yet
-
defineDataFormat
public Instances defineDataFormat() throws java.lang.Exception
Initializes the format for the dataset produced. Must be called before the generateExample or generateExamples methods are used. Re-initializes the random number generator with the given seed.- Overrides:
defineDataFormat
in classDataGenerator
- Returns:
- the format for the dataset
- Throws:
java.lang.Exception
- if the generating of the format failed- See Also:
DataGenerator.getSeed()
-
generateExample
public Instance generateExample() throws java.lang.Exception
Generates one example of the dataset.- Specified by:
generateExample
in classDataGenerator
- Returns:
- the generated example
- Throws:
java.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 mode
-
generateExamples
public Instances generateExamples() throws java.lang.Exception
Generates all examples of the dataset. Re-initializes the random number generator with the given seed, before generating instances.- Specified by:
generateExamples
in classDataGenerator
- Returns:
- the generated dataset
- Throws:
java.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 mode- See Also:
DataGenerator.getSeed()
-
generateStart
public java.lang.String generateStart()
Generates a comment string that documentates the data generator. By default this string is added at the beginning of the produced output as ARFF file type, next after the options.- Specified by:
generateStart
in classDataGenerator
- Returns:
- string contains info about the generated rules
-
generateFinished
public java.lang.String generateFinished() throws java.lang.Exception
Generates a comment string that documentats the data generator. By default this string is added at the end of theproduces output as ARFF file type.- Specified by:
generateFinished
in classDataGenerator
- Returns:
- string contains info about the generated rules
- Throws:
java.lang.Exception
- if the generating of the documentaion fails
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Main method for executing this class.- Parameters:
args
- should contain arguments for the data producer:
-
-