|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.datagenerators.ClusterGenerator
public abstract class ClusterGenerator
Abstract class for cluster data generators. -------------------------------------------------------------------
General options are:
-r string
Name of the relation of the generated dataset.
(default = name built using name of used generator and options)
-a num
Number of attributes. (default = 2)
-k num
Number of clusters. (default = 4)
-c
Class Flag. If set, cluster is listed in extra class attribute.
-o filename
writes the generated dataset to the given file using ARFF-Format.
(default = stdout).
-------------------------------------------------------------------
Example usage as the main of a datagenerator called RandomGenerator:
public static void main(String [] args) {
try {
DataGenerator.makeData(new RandomGenerator(), argv);
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
------------------------------------------------------------------
| Constructor Summary | |
|---|---|
ClusterGenerator()
|
|
| Method Summary | |
|---|---|
boolean |
getClassFlag()
Gets the class flag. |
boolean |
getDebug()
Gets the debug flag. |
int |
getNumAttributes()
Gets the number of attributes that should be produced. |
int |
getNumClusters()
Gets the number of clusters the dataset should have. |
int |
getNumExamplesAct()
Gets the number of examples the dataset should have. |
java.io.PrintWriter |
getOutput()
Gets the print writer. |
java.lang.String |
getRelationName()
Gets the relation name the dataset should have. |
static void |
makeData(ClusterGenerator generator,
java.lang.String[] options)
Calls the data generator. |
void |
setClassFlag(boolean classFlag)
Sets the class flag, if class flag is set, the cluster is listed as class atrribute in an extra attribute. |
void |
setDebug(boolean debug)
Sets the debug flag. |
void |
setNumAttributes(int numAttributes)
Sets the number of attributes the dataset should have. |
void |
setNumClusters(int numClusters)
Sets the number of clusters the dataset should have. |
void |
setNumExamplesAct(int numExamplesAct)
Sets the number of examples the dataset should have. |
void |
setOutput(java.io.PrintWriter newOutput)
Sets the print writer. |
void |
setRelationName(java.lang.String relationName)
Sets the relation name the dataset should have. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClusterGenerator()
| Method Detail |
|---|
public void setClassFlag(boolean classFlag)
classFlag - the new class flagpublic boolean getClassFlag()
public void setDebug(boolean debug)
debug - the new debug flagpublic boolean getDebug()
public void setRelationName(java.lang.String relationName)
relationName - the new relation namepublic java.lang.String getRelationName()
public void setNumClusters(int numClusters)
numClusters - the new number of clusterspublic int getNumClusters()
public void setNumAttributes(int numAttributes)
numAttributes - the new number of attributespublic int getNumAttributes()
public void setNumExamplesAct(int numExamplesAct)
numExamplesAct - the new number of examplespublic int getNumExamplesAct()
public void setOutput(java.io.PrintWriter newOutput)
newOutput - the new print writerpublic java.io.PrintWriter getOutput()
public static void makeData(ClusterGenerator generator,
java.lang.String[] options)
throws java.lang.Exception
dataGenerator - one of the data generatorsoptions - options of the data generator
java.lang.Exception - if there was an error in the option list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||