All Packages Class Hierarchy This Package Previous Next Index WEKA's home
java.lang.Object
|
+----weka.clusterers.Clusterer
|
+----weka.clusterers.XMeans
Valid options are:
-I
-M
-J
-L
-H
-B
-K
-C
-D
-O
-S
-U
-Y
major TODOS:
make BIC-Score replaceable by other scores
Maximum number of iterations in the overall loop (default = 1).
Maximum number of iterations in the kMeans loop in
the Improve-Parameter part (default = 1000).
Maximum number of iterations in the kMeans loop for the splitted
centroids in the Improve-Structure part (default = 1000).
Specify the number of clusters to start with.
Specify the maximal number of clusters.
Distance value between true and false of binary attributes and
"same" and "different" of nominal attributes (default = 1.0).
KDTrees class and its options (can only use the same distance function
as XMeans).
If none of the children are better, percentage of the best splits
to be taken.
Input starting cluster centers from file (ARFF-format).
Output cluster centers to file (ARFF-format).
Specify random number seed.
Set debuglevel.
Used for debugging: Input random vektors from file.
D_CONVCHCLOSER
D_CURR
D_FOLLOWSPLIT
D_GENERAL
D_ITERCOUNT
D_KDTREE
D_METH_MISUSE
D_PRINTCENTERS
D_RANDOMVEKTOR
m_CurrDebugFlag
R_HIGH
R_LOW
R_WIDTH
XMeans()
binValueTipText()
buildClusterer(Instances)
checkForNominalAttributes(Instances)
clusterInstance(Instance)
getBinValue()
getCutOffFactor()
getDebugLevel()
getDistanceF()
getInputCenterFile()
getKDTree()
getMaxIterations()
getMaxKMeans()
getMaxKMeansForChildren()
getMaxNumClusters()
getMinNumClusters()
getNextDebugVektorsInstance(Instances)
getOptions()
getOutputCenterFile()
getSeed()
globalInfo()
initDebugVektorsInput()
initializeRanges(Instances, int[])
listOptions()
main(String[])
maxNumClustersTipText()
minNumClustersTipText()
numberOfClusters()
printRanges(Instances, double[][])
seedTipText()
setBinValue(double)
setCutOffFactor(double)
setDebugLevel(int)
setDebugVektorsFile(String)
setDistanceF(DistanceFunction)
setInputCenterFile(String)
setKDTree(KDTree)
setMaxIterations(int)
setMaxKMeans(int)
setMaxKMeansForChildren(int)
setMaxNumClusters(int)
setMinNumClusters(int)
setOptions(String[])
setOutputCenterFile(String)
setSeed(int)
toString()
updateRanges(Instance, int, double[][])
updateRangesFirst(Instance, int, double[][])
R_LOW
public static int R_LOW
Index in ranges for LOW and HIGH and WIDTH
R_HIGH
public static int R_HIGH
R_WIDTH
public static int R_WIDTH
D_PRINTCENTERS
public static int D_PRINTCENTERS
D_FOLLOWSPLIT
public static int D_FOLLOWSPLIT
D_CONVCHCLOSER
public static int D_CONVCHCLOSER
D_RANDOMVEKTOR
public static int D_RANDOMVEKTOR
D_KDTREE
public static int D_KDTREE
D_ITERCOUNT
public static int D_ITERCOUNT
D_METH_MISUSE
public static int D_METH_MISUSE
D_CURR
public static int D_CURR
D_GENERAL
public static int D_GENERAL
m_CurrDebugFlag
public boolean m_CurrDebugFlag
XMeans
public XMeans()
globalInfo
public java.lang.String globalInfo()
Returns a string describing this clusterer
initializeRanges
public static double[][] initializeRanges(Instances instances,
int instList[])
Function should be in the Instances class!!
Initializes the minimum and maximum values
based on all instances.
instList - list of indexes
printRanges
public static void printRanges(Instances model,
double ranges[][])
Function should be in the Instances class!!
Prints a range.
ranges - the ranges to print
updateRangesFirst
public static void updateRangesFirst(Instance instance,
int numAtt,
double ranges[][])
Function should be in the Instances class!!
Used to initialize the ranges. For this the values
of the first instance is used to save time.
Sets low and high to the values of the first instance and
width to zero.
instance - the new instance
numAtt - number of attributes in the model
updateRanges
public static void updateRanges(Instance instance,
int numAtt,
double ranges[][])
Function should be in the Instances class!!
Updates the minimum and maximum and width values for all the attributes
based on a new instance.
instance - the new instance
numAtt - number of attributes in the model
ranges - low, high and width values for all attributes
buildClusterer
public void buildClusterer(Instances data) throws java.lang.Exception
Generates the X-Means clusterer.
data - set of instances serving as training data
checkForNominalAttributes
public boolean checkForNominalAttributes(Instances data)
Checks for nominal attributes in the dataset.
Class attribute is ignored.
data -
clusterInstance
public int clusterInstance(Instance instance) throws java.lang.Exception
Classifies a given instance.
instance - the instance to be assigned to a cluster
numberOfClusters
public int numberOfClusters()
Returns the number of clusters.
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.
minNumClustersTipText
public java.lang.String minNumClustersTipText()
Returns the tip text for this property
maxNumClustersTipText
public java.lang.String maxNumClustersTipText()
Returns the tip text for this property
setMaxIterations
public void setMaxIterations(int i) throws java.lang.Exception
Sets the maximum number of iterations to perform.
i - the number of iterations
getMaxIterations
public int getMaxIterations()
Gets the maximum number of iterations.
setMaxKMeans
public void setMaxKMeans(int i)
Set the maximum number of iterations to perform in KMeans
i - the number of iterations
getMaxKMeans
public int getMaxKMeans()
Gets the maximum number of iterations in KMeans.
setMaxKMeansForChildren
public void setMaxKMeansForChildren(int i) throws java.lang.Exception
Sets the maximum number of iterations KMeans that is performed
on the child centers.
i - the number of iterations
getMaxKMeansForChildren
public int getMaxKMeansForChildren()
Gets the maximum number of iterations in KMeans.
setCutOffFactor
public void setCutOffFactor(double i) throws java.lang.Exception
Sets a new cutoff factor.
i - the new cutoff factor
getCutOffFactor
public double getCutOffFactor()
Gets the cutoff factor.
setMinNumClusters
public void setMinNumClusters(int n)
Sets the minimum number of clusters to generate.
n - the minimum number of clusters to generate
setMaxNumClusters
public void setMaxNumClusters(int n)
Sets the maximum number of clusters to generate.
n - the maximum number of clusters to generate
binValueTipText
public java.lang.String binValueTipText()
Returns the tip text for this property
getBinValue
public double getBinValue()
Gets value that represents true in a new numeric attribute.
(False is always represented by 0.0.)
setBinValue
public void setBinValue(double value)
Sets the distance e value between true and false of binary attributes
and "same" and "different" of nominal attributes
double - value
setDistanceF
public void setDistanceF(DistanceFunction distanceF)
gets the "binary" distance value
distanceF - the distance function with all options set
getDistanceF
public DistanceFunction getDistanceF()
Gets the distance function.
setDebugVektorsFile
public void setDebugVektorsFile(java.lang.String fileName)
Sets a file name for a file that has the random vektors stored.
Just used for debugging reasons.
fileName - file name for the file to read the random vektors from
initDebugVektorsInput
public void initDebugVektorsInput() throws java.lang.Exception
Initialises the debug vektor input.
getNextDebugVektorsInstance
public Instance getNextDebugVektorsInstance(Instances model) throws java.lang.Exception
Read an instance from debug vektors file.
model - the data model for the instance
setInputCenterFile
public void setInputCenterFile(java.lang.String fileName)
Sets the name of the file to read the list of centers from.
fileName - file name of file to read centers from
setOutputCenterFile
public void setOutputCenterFile(java.lang.String fileName)
Sets the name of the file to write the list of centers to.
fileName - file to write centers to
getInputCenterFile
public java.lang.String getInputCenterFile()
Gets the name of the file to read the list of centers from.
getOutputCenterFile
public java.lang.String getOutputCenterFile()
Gets the name of the file to write the list of centers to.
setKDTree
public void setKDTree(KDTree k)
Sets the KDTree class.
k - a KDTree object with all options set
getKDTree
public KDTree getKDTree()
Gets the KDTree class.
setDebugLevel
public void setDebugLevel(int d)
Sets the debug level.
debug level = 0, means no output
d - debuglevel
getDebugLevel
public int getDebugLevel()
Gets the debug level.
getMinNumClusters
public int getMinNumClusters()
Gets the minimum number of clusters to generate.
getMaxNumClusters
public int getMaxNumClusters()
Gets the maximum number of clusters to generate.
seedTipText
public java.lang.String seedTipText()
Returns the tip text for this property.
setSeed
public void setSeed(int s)
Sets the random number seed.
s - the seed
getSeed
public int getSeed()
Gets the random number seed.
setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
Parses a given list of options.
options - the list of options as an array of strings
getOptions
public java.lang.String[] getOptions()
Gets the current settings of SimpleKMeans.
toString
public java.lang.String toString()
Return a string describing this clusterer.
main
public static void main(java.lang.String argv[])
Main method for testing this class.
argv - should contain options
All Packages Class Hierarchy This Package Previous Next Index WEKA's home