类 DataGenerator
java.lang.Object
weka.datagenerators.DataGenerator
- 所有已实现的接口:
Serializable
,OptionHandler
,Randomizable
,RevisionHandler
public abstract class DataGenerator
extends Object
implements OptionHandler, Randomizable, Serializable, RevisionHandler
Abstract superclass for data generators that generate data for classifiers
and clusterers.
- 版本:
- $Revision: 1.8 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this propertyGets the writer, which is used for outputting to stdout.Initializes the format for the dataset produced.Returns the tip text for this propertyabstract Instance
Generates one example of the dataset.abstract Instances
Generates all examples of the dataset.abstract String
Generates a comment string that documentates the data generator.abstract String
Generates a comment string that documentates the data generator.Gets the format of the dataset that is to be generated.boolean
getDebug()
Gets the debug flag.int
Gets the number of examples the dataset should have.String[]
Gets the current settings of the datagenerator RDG1.Gets the print writer.Gets the random generator.Gets the relation name the dataset should have.int
getSeed()
Gets the random number seed.abstract boolean
Return if single mode is set for the given data generator mode depends on option setting and or generator type.Returns an enumeration describing the available options.static void
makeData
(DataGenerator generator, String[] options) Calls the data generator.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyvoid
setDatasetFormat
(Instances newFormat) Sets the format of the dataset that is to be generated.void
setDebug
(boolean debug) Sets the debug flag.void
setOptions
(String[] options) Parses a list of options for this object.void
setOutput
(PrintWriter newOutput) Sets the print writer.void
Sets the random generator.void
setRelationName
(String relationName) Sets the relation name the dataset should have.void
setSeed
(int newSeed) Sets the random number seed.从接口继承的方法 weka.core.RevisionHandler
getRevision
-
构造器详细资料
-
DataGenerator
public DataGenerator()initializes with default settings.
Note: default values are set via a default<name> method. These default methods are also used in the listOptions method and in the setOptions method. Why? Derived generators can override the return value of these default methods, to avoid exceptions.
-
-
方法详细资料
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options
-
setOptions
Parses a list of options for this object. For list of valid options see class description.- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the datagenerator RDG1. Removing of blacklisted options has to be done in the derived class, that defines the blacklist-entry.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
- 另请参阅:
-
removeBlacklist(String[])
-
defineDataFormat
Initializes the format for the dataset produced. Must be called before the generateExample or generateExamples methods are used. Also sets a default relation name in case the current relation name is empty.- 返回:
- the format for the dataset
- 抛出:
Exception
- if the generating of the format failed- 另请参阅:
-
defaultRelationName()
-
generateExample
Generates one example of the dataset. -
generateExamples
Generates all examples of the dataset. -
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.- 返回:
- string contains info about the generated rules
- 抛出:
Exception
- if the generating of the documentation fails
-
generateFinished
Generates a comment string that documentates the data generator. By default this string is added at the end of the produced output as ARFF file type.- 返回:
- string contains info about the generated rules
- 抛出:
Exception
- if the generating of the documentation fails
-
getSingleModeFlag
Return if single mode is set for the given data generator mode depends on option setting and or generator type.- 返回:
- single mode flag
- 抛出:
Exception
- if mode is not set yet
-
setDebug
public void setDebug(boolean debug) Sets the debug flag.- 参数:
debug
- the new debug flag
-
getDebug
public boolean getDebug()Gets the debug flag.- 返回:
- the debug flag
-
debugTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setRelationName
Sets the relation name the dataset should have.- 参数:
relationName
- the new relation name
-
getRelationName
Gets the relation name the dataset should have.- 返回:
- the relation name the dataset should have
-
relationNameTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getNumExamplesAct
public int getNumExamplesAct()Gets the number of examples the dataset should have.- 返回:
- the number of examples the dataset should have
-
setOutput
Sets the print writer.- 参数:
newOutput
- the new print writer
-
getOutput
Gets the print writer.- 返回:
- print writer object
-
defaultOutput
Gets the writer, which is used for outputting to stdout. A workaround for the problem of closing stdout when closing the associated Printwriter.- 返回:
- writer object
-
outputTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDatasetFormat
Sets the format of the dataset that is to be generated.- 参数:
newFormat
- the new dataset format of the dataset
-
getDatasetFormat
Gets the format of the dataset that is to be generated.- 返回:
- the dataset format of the dataset
-
formatTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSeed
public int getSeed()Gets the random number seed.- 指定者:
getSeed
在接口中Randomizable
- 返回:
- the random number seed.
-
setSeed
public void setSeed(int newSeed) Sets the random number seed.- 指定者:
setSeed
在接口中Randomizable
- 参数:
newSeed
- the new random number seed.
-
seedTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getRandom
Gets the random generator.- 返回:
- the random generator
-
setRandom
Sets the random generator.- 参数:
newRandom
- is the random generator.
-
randomTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
makeData
Calls the data generator.- 参数:
generator
- one of the data generatorsoptions
- options of the data generator- 抛出:
Exception
- if there was an error in the option list
-