Class Agrawal
- java.lang.Object
-
- weka.datagenerators.DataGenerator
-
- weka.datagenerators.ClassificationGenerator
-
- weka.datagenerators.classifiers.classification.Agrawal
-
- All Implemented Interfaces:
java.io.Serializable,OptionHandler,Randomizable,RevisionHandler,TechnicalInformationHandler
public class Agrawal extends ClassificationGenerator implements TechnicalInformationHandler
Generates a people database and is based on the paper by Agrawal et al.:
R. Agrawal, T. Imielinski, A. Swami (1993). Database Mining: A Performance Perspective. IEEE Transactions on Knowledge and Data Engineering. 5(6):914-925. URL http://www.almaden.ibm.com/software/quest/Publications/ByDate.html. BibTeX:@article{Agrawal1993, author = {R. Agrawal and T. Imielinski and A. Swami}, journal = {IEEE Transactions on Knowledge and Data Engineering}, note = {Special issue on Learning and Discovery in Knowledge-Based Databases}, number = {6}, pages = {914-925}, title = {Database Mining: A Performance Perspective}, volume = {5}, year = {1993}, URL = {http://www.almaden.ibm.com/software/quest/Publications/ByDate.html}, PDF = {http://www.almaden.ibm.com/software/quest/Publications/papers/tkde93.pdf} }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)
-F <num> The function to use for generating the data. (default 1)
-B Whether to balance the class.
-P <num> The perturbation factor. (default 0.05)
- 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
-
-
Field Summary
Fields Modifier and Type Field Description static intFUNCTION_1function 1static intFUNCTION_10function 10static intFUNCTION_2function 2static intFUNCTION_3function 3static intFUNCTION_4function 4static intFUNCTION_5function 5static intFUNCTION_6function 6static intFUNCTION_7function 7static intFUNCTION_8function 8static intFUNCTION_9function 9static Tag[]FUNCTION_TAGSthe funtion tags
-
Constructor Summary
Constructors Constructor Description Agrawal()initializes the generator with default values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbalanceClassTipText()Returns the tip text for this propertyInstancesdefineDataFormat()Initializes the format for the dataset produced.java.lang.StringfunctionTipText()Returns the tip text for this propertyInstancegenerateExample()Generates one example of the dataset.InstancesgenerateExamples()Generates all examples of the dataset.java.lang.StringgenerateFinished()Generates a comment string that documentats the data generator.java.lang.StringgenerateStart()Generates a comment string that documentates the data generator.booleangetBalanceClass()Gets whether the class is balanced.SelectedTaggetFunction()Gets the function for generating the data.java.lang.String[]getOptions()Gets the current settings of the datagenerator.doublegetPerturbationFraction()Gets the perturbation fraction.java.lang.StringgetRevision()Returns the revision string.booleangetSingleModeFlag()Return if single mode is set for the given data generator mode depends on option setting and or generator type.TechnicalInformationgetTechnicalInformation()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.StringglobalInfo()Returns a string describing this data generator.java.util.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(java.lang.String[] args)Main method for executing this class.java.lang.StringperturbationFractionTipText()Returns the tip text for this propertyvoidsetBalanceClass(boolean value)Sets whether the class is balanced.voidsetFunction(SelectedTag value)Sets the function for generating the data.voidsetOptions(java.lang.String[] options)Parses a list of options for this object.voidsetPerturbationFraction(double value)Sets the perturbation fraction.-
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
-
-
-
-
Field Detail
-
FUNCTION_1
public static final int FUNCTION_1
function 1- See Also:
- Constant Field Values
-
FUNCTION_2
public static final int FUNCTION_2
function 2- See Also:
- Constant Field Values
-
FUNCTION_3
public static final int FUNCTION_3
function 3- See Also:
- Constant Field Values
-
FUNCTION_4
public static final int FUNCTION_4
function 4- See Also:
- Constant Field Values
-
FUNCTION_5
public static final int FUNCTION_5
function 5- See Also:
- Constant Field Values
-
FUNCTION_6
public static final int FUNCTION_6
function 6- See Also:
- Constant Field Values
-
FUNCTION_7
public static final int FUNCTION_7
function 7- See Also:
- Constant Field Values
-
FUNCTION_8
public static final int FUNCTION_8
function 8- See Also:
- Constant Field Values
-
FUNCTION_9
public static final int FUNCTION_9
function 9- See Also:
- Constant Field Values
-
FUNCTION_10
public static final int FUNCTION_10
function 10- See Also:
- Constant Field Values
-
FUNCTION_TAGS
public static final Tag[] FUNCTION_TAGS
the funtion tags
-
-
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:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classClassificationGenerator- Returns:
- an enumeration of all the available options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses 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)
-F <num> The function to use for generating the data. (default 1)
-B Whether to balance the class.
-P <num> The perturbation factor. (default 0.05)
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin 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:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classClassificationGenerator- Returns:
- an array of strings suitable for passing to setOptions
- See Also:
DataGenerator.removeBlacklist(String[])
-
getFunction
public SelectedTag getFunction()
Gets the function for generating the data.- Returns:
- the function.
- See Also:
FUNCTION_TAGS
-
setFunction
public void setFunction(SelectedTag value)
Sets the function for generating the data.- Parameters:
value- the function.- See Also:
FUNCTION_TAGS
-
functionTipText
public java.lang.String functionTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getBalanceClass
public boolean getBalanceClass()
Gets whether the class is balanced.- Returns:
- whether the class is balanced.
-
setBalanceClass
public void setBalanceClass(boolean value)
Sets whether the class is balanced.- Parameters:
value- whether to balance the class.
-
balanceClassTipText
public java.lang.String balanceClassTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getPerturbationFraction
public double getPerturbationFraction()
Gets the perturbation fraction.- Returns:
- the perturbation fraction.
-
setPerturbationFraction
public void setPerturbationFraction(double value)
Sets the perturbation fraction.- Parameters:
value- the perturbation fraction.
-
perturbationFractionTipText
public java.lang.String perturbationFractionTipText()
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.ExceptionReturn if single mode is set for the given data generator mode depends on option setting and or generator type.- Specified by:
getSingleModeFlagin 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:
defineDataFormatin 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:
generateExamplein 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:
generateExamplesin 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:
generateStartin classDataGenerator- Returns:
- string contains info about the generated rules
-
generateFinished
public java.lang.String generateFinished() throws java.lang.ExceptionGenerates 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:
generateFinishedin 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:
getRevisionin 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:
-
-