public class RandomRBF extends ClassificationGenerator
-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)
Modifier and Type | Field and Description |
---|---|
protected int[] |
m_centroidClasses
the classes of the centroids
|
protected double[][] |
m_centroids
the centroids
|
protected double[] |
m_centroidStdDevs
the stddevs of the centroids
|
protected double[] |
m_centroidWeights
the weights of the centroids
|
protected int |
m_NumAttributes
Number of attribute the dataset should have
|
protected int |
m_NumCentroids
the number of centroids to use for generation
|
protected int |
m_NumClasses
Number of Classes the dataset should have
|
m_NumExamples
m_CreatingRelationName, m_DatasetFormat, m_Debug, m_DefaultOutput, m_NumExamplesAct, m_OptionBlacklist, m_Output, m_Random, m_RelationName, m_Seed
Constructor and Description |
---|
RandomRBF()
initializes the generator with default values
|
Modifier and Type | Method and Description |
---|---|
protected int |
chooseRandomIndexBasedOnProportions(double[] proportionArray,
Random random)
returns a random index based on the given proportions
|
protected int |
defaultNumAttributes()
returns the default number of attributes
|
protected int |
defaultNumCentroids()
returns the default number of centroids
|
protected int |
defaultNumClasses()
returns the default number of classes
|
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.
|
String |
generateFinished()
Generates a comment string that documentats the data generator.
|
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.
|
String[] |
getOptions()
Gets the current settings of the datagenerator.
|
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.
|
String |
globalInfo()
Returns a string describing this data generator.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for executing this class.
|
String |
numAttributesTipText()
Returns the tip text for this property
|
String |
numCentroidsTipText()
Returns the tip text for this property
|
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(String[] options)
Parses a list of options for this object.
|
defaultNumExamples, getNumExamples, numExamplesTipText, setNumExamples
addToBlacklist, clearBlacklist, debugTipText, defaultNumExamplesAct, defaultOutput, defaultRelationName, defaultSeed, enumToVector, formatTipText, getDatasetFormat, getDebug, getNumExamplesAct, getOutput, getRandom, getRelationName, getRelationNameToUse, getSeed, isOnBlacklist, makeData, makeOptionString, numExamplesActTipText, outputTipText, randomTipText, relationNameTipText, removeBlacklist, runDataGenerator, seedTipText, setDatasetFormat, setDebug, setNumExamplesAct, setOutput, setRandom, setRelationName, setSeed, toStringFormat
protected int m_NumAttributes
protected int m_NumClasses
protected int m_NumCentroids
protected double[][] m_centroids
protected int[] m_centroidClasses
protected double[] m_centroidWeights
protected double[] m_centroidStdDevs
public String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class ClassificationGenerator
public void setOptions(String[] options) throws 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 stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class ClassificationGenerator
DataGenerator.removeBlacklist(String[])
protected int defaultNumAttributes()
public void setNumAttributes(int numAttributes)
numAttributes
- the new number of attributespublic int getNumAttributes()
public String numAttributesTipText()
protected int defaultNumClasses()
public void setNumClasses(int numClasses)
numClasses
- the new number of classespublic int getNumClasses()
public String numClassesTipText()
protected int defaultNumCentroids()
public int getNumCentroids()
public void setNumCentroids(int value)
value
- the number of centroids to use.public String numCentroidsTipText()
public boolean getSingleModeFlag() throws Exception
getSingleModeFlag
in class DataGenerator
Exception
- if mode is not set yetprotected int chooseRandomIndexBasedOnProportions(double[] proportionArray, Random random)
proportionArray
- the proportionsrandom
- the random number generator to usepublic Instances defineDataFormat() throws Exception
defineDataFormat
in class DataGenerator
Exception
- if the generating of the format failedDataGenerator.getSeed()
public Instance generateExample() throws Exception
generateExample
in class DataGenerator
Exception
- if the format of the dataset is not yet definedException
- if the generator only works with generateExamples
which means in non single modepublic Instances generateExamples() throws Exception
generateExamples
in class DataGenerator
Exception
- if the format of the dataset is not yet definedException
- if the generator only works with generateExample,
which means in single modeDataGenerator.getSeed()
public String generateStart()
generateStart
in class DataGenerator
public String generateFinished() throws Exception
generateFinished
in class DataGenerator
Exception
- if the generating of the documentaion failspublic String getRevision()
public static void main(String[] args)
args
- should contain arguments for the data producer:Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.