|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.datagenerators.DataGenerator
weka.datagenerators.ClassificationGenerator
weka.datagenerators.classifiers.classification.RandomRBF
public class RandomRBF
RandomRBF data is generated by first creating a random set of centers for each class. Each center is randomly assigned a weight, a central point per attribute, and a standard deviation. To generate new instances, a center is chosen at random taking the weights of each center into consideration. Attribute values are randomly generated and offset from the center, where the overall vector has been scaled so that its length equals a value sampled randomly from the Gaussian distribution of the center. The particular center chosen determines the class of the instance.
RandomRBF data contains only numeric attributes as it is non-trivial to include nominal values.
-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)
-C <num> The number of centroids to use. (default 50)
Constructor Summary | |
---|---|
RandomRBF()
initializes the generator with default values |
Method Summary | |
---|---|
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. |
int |
getNumAttributes()
Gets the number of attributes that should be produced. |
int |
getNumCentroids()
Gets the number of centroids. |
int |
getNumClasses()
Gets the number of classes the dataset should have. |
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. |
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 |
numAttributesTipText()
Returns the tip text for this property |
java.lang.String |
numCentroidsTipText()
Returns the tip text for this property |
java.lang.String |
numClassesTipText()
Returns the tip text for this property |
void |
setNumAttributes(int numAttributes)
Sets the number of attributes the dataset should have. |
void |
setNumCentroids(int value)
Sets the number of centroids to use. |
void |
setNumClasses(int numClasses)
Sets the number of classes the dataset should have. |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomRBF()
Method Detail |
---|
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class ClassificationGenerator
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 number of attributes (default 10).
-c <num> The number of classes (default 2)
-C <num> The number of centroids to use. (default 50)
setOptions
in interface OptionHandler
setOptions
in class ClassificationGenerator
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 ClassificationGenerator
DataGenerator.removeBlacklist(String[])
public void setNumAttributes(int numAttributes)
numAttributes
- the new number of attributespublic int getNumAttributes()
public java.lang.String numAttributesTipText()
public void setNumClasses(int numClasses)
numClasses
- the new number of classespublic int getNumClasses()
public java.lang.String numClassesTipText()
public int getNumCentroids()
public void setNumCentroids(int value)
value
- the number of centroids to use.public java.lang.String numCentroidsTipText()
public boolean getSingleModeFlag() throws java.lang.Exception
getSingleModeFlag
in class DataGenerator
java.lang.Exception
- if mode is not set yetpublic Instances defineDataFormat() throws java.lang.Exception
defineDataFormat
in class DataGenerator
java.lang.Exception
- if the generating of the format failedDataGenerator.getSeed()
public Instance generateExample() throws java.lang.Exception
generateExample
in class DataGenerator
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 DataGenerator
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 DataGenerator
public java.lang.String generateFinished() throws java.lang.Exception
generateFinished
in class DataGenerator
java.lang.Exception
- if the generating of the documentaion failspublic java.lang.String getRevision()
public 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 |