Package weka.datagenerators
Class ClusterGenerator
- java.lang.Object
-
- weka.datagenerators.DataGenerator
-
- weka.datagenerators.ClusterGenerator
-
- All Implemented Interfaces:
Serializable,OptionHandler,Randomizable,RevisionHandler
- Direct Known Subclasses:
BIRCHCluster,SubspaceCluster
public abstract class ClusterGenerator extends DataGenerator
Abstract class for cluster data generators. Example usage as the main of a datagenerator called RandomGenerator:public static void main(String[] args) { try { DataGenerator.makeData(new RandomGenerator(), args); } catch (Exception e) { e.printStackTrace(); System.err.println(e.getMessage()); } }- Version:
- $Revision$
- Author:
- Gabi Schmidberger (gabi@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClusterGenerator()initializes the generator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringclassFlagTipText()Returns the tip text for this propertybooleangetClassFlag()Gets the class flag.intgetNumAttributes()Gets the number of attributes that should be produced.String[]getOptions()Gets the current settings of the classifier.Enumeration<Option>listOptions()Returns an enumeration describing the available options.StringnumAttributesTipText()Returns the tip text for this propertyvoidsetClassFlag(boolean classFlag)Sets the class flag, if class flag is set, the cluster is listed as class atrribute in an extra attribute.voidsetNumAttributes(int numAttributes)Sets the number of attributes the dataset should have.voidsetOptions(String[] options)Sets the options.-
Methods inherited from class weka.datagenerators.DataGenerator
debugTipText, defaultOutput, defineDataFormat, enumToVector, formatTipText, generateExample, generateExamples, generateFinished, generateStart, getDatasetFormat, getDebug, getEpilogue, getNumExamplesAct, getOutput, getPrologue, getRandom, getRelationName, getSeed, getSingleModeFlag, makeData, outputTipText, randomTipText, relationNameTipText, runDataGenerator, seedTipText, setDatasetFormat, setDebug, setOutput, setRandom, setRelationName, setSeed
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface weka.core.RevisionHandler
getRevision
-
-
-
-
Method Detail
-
listOptions
public Enumeration<Option> listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classDataGenerator- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(String[] options) throws Exception
Sets the options.- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classDataGenerator- Parameters:
options- the options- Throws:
Exception- if invalid option
-
getOptions
public String[] getOptions()
Gets the current settings of the classifier.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classDataGenerator- Returns:
- an array of strings suitable for passing to setOptions
- See Also:
DataGenerator.removeBlacklist(String[])
-
setNumAttributes
public void setNumAttributes(int numAttributes)
Sets the number of attributes the dataset should have.- Parameters:
numAttributes- the new number of attributes
-
getNumAttributes
public int getNumAttributes()
Gets the number of attributes that should be produced.- Returns:
- the number of attributes that should be produced
-
numAttributesTipText
public String numAttributesTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassFlag
public void setClassFlag(boolean classFlag)
Sets the class flag, if class flag is set, the cluster is listed as class atrribute in an extra attribute.- Parameters:
classFlag- the new class flag
-
getClassFlag
public boolean getClassFlag()
Gets the class flag.- Returns:
- the class flag
-
classFlagTipText
public String classFlagTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
-