|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.datagenerators.DataGenerator
weka.datagenerators.RegressionGenerator
weka.datagenerators.classifiers.regression.MexicanHat
weka.datagenerators.classifiers.regression.Expression
public class Expression
A data generator for generating y according to a given expression out of randomly generated x.
E.g., the mexican hat can be generated like this:
sin(abs(a1)) / abs(a1)
In addition to this function, the amplitude can be changed and gaussian noise can be added.
-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 amplitude multiplier (default 1.0).
-R <num>..<num> The range x is randomly drawn from (default -10.0..10.0).
-N <num> The noise rate (default 0.0).
-V <num> The noise variance (default 1.0).
-E <expression> The expression to use for generating y out of x (default sin(abs(a1)) / abs(a1)).
AddExpression
,
MexicanHat
,
Serialized FormConstructor Summary | |
---|---|
Expression()
initializes the generator |
Method Summary | |
---|---|
java.lang.String |
amplitudeTipText()
Returns the tip text for this property |
Instances |
defineDataFormat()
Initializes the format for the dataset produced. |
java.lang.String |
expressionTipText()
Returns the tip text for this property |
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. |
java.lang.String |
getExpression()
Gets the mathematical expression for generating y out of x |
java.lang.String[] |
getOptions()
Gets the current settings of the datagenerator BIRCHCluster. |
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 |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
void |
setExpression(java.lang.String value)
Sets the mathematical expression to generate y out of x. |
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object. |
Methods inherited from class weka.datagenerators.classifiers.regression.MexicanHat |
---|
getAmplitude, getMaxRange, getMinRange, getNoiseRate, getNoiseVariance, maxRangeTipText, minRangeTipText, noiseRateTipText, noiseVarianceTipText, setAmplitude, setMaxRange, setMinRange, setNoiseRate, setNoiseVariance |
Methods inherited from class weka.datagenerators.RegressionGenerator |
---|
getNumExamples, numExamplesTipText, setNumExamples |
Methods inherited from class weka.datagenerators.DataGenerator |
---|
debugTipText, defaultOutput, formatTipText, getDatasetFormat, getDebug, getOutput, getRandom, getRelationName, getSeed, makeData, outputTipText, randomTipText, relationNameTipText, seedTipText, setDatasetFormat, setDebug, setOutput, setRandom, setRelationName, setSeed |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public java.lang.String globalInfo()
globalInfo
in class MexicanHat
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class MexicanHat
public 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 amplitude multiplier (default 1.0).
-R <num>..<num> The range x is randomly drawn from (default -10.0..10.0).
-N <num> The noise rate (default 0.0).
-V <num> The noise variance (default 1.0).
-E <expression> The expression to use for generating y out of x (default sin(abs(a1)) / abs(a1)).
setOptions
in interface OptionHandler
setOptions
in class MexicanHat
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class MexicanHat
DataGenerator.removeBlacklist(String[])
public java.lang.String amplitudeTipText()
amplitudeTipText
in class MexicanHat
public java.lang.String getExpression()
public void setExpression(java.lang.String value)
value
- the expression for computing ypublic java.lang.String expressionTipText()
public boolean getSingleModeFlag() throws java.lang.Exception
getSingleModeFlag
in class MexicanHat
java.lang.Exception
- if mode is not set yetpublic Instances defineDataFormat() throws java.lang.Exception
defineDataFormat
in class MexicanHat
java.lang.Exception
- if the generating of the format failedDataGenerator.getSeed()
public Instance generateExample() throws java.lang.Exception
generateExample
in class MexicanHat
java.lang.Exception
- if the format of the dataset is not yet defined
java.lang.Exception
- if the generator only works with generateExamples
which means in non single modepublic Instances generateExamples() throws java.lang.Exception
generateExamples
in class MexicanHat
java.lang.Exception
- if the format of the dataset is not yet defined
java.lang.Exception
- if the generator only works with generateExample,
which means in single modeDataGenerator.getSeed()
public java.lang.String generateStart()
generateStart
in class MexicanHat
public java.lang.String generateFinished() throws java.lang.Exception
generateFinished
in class MexicanHat
java.lang.Exception
- if the generating of the documentaion failspublic static void main(java.lang.String[] args)
args
- should contain arguments for the data producer:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |