All Packages Class Hierarchy This Package Previous Next Index WEKA's home
java.lang.Object | +----weka.clusterers.Clusterer | +----weka.clusterers.SimpleKMeans
-N
-S
Valid options are:
-N
-S
-t training file [-N number of clusters]
Specify the number of clusters to generate.
Specify random number seed.
buildClusterer(Instances)
clusterInstance(Instance)
getNumClusters()
getOptions()
getSeed()
globalInfo()
listOptions()
main(String[])
numberOfClusters()
numClustersTipText()
seedTipText()
setNumClusters(int)
setOptions(String[])
setSeed(int)
toString()
SimpleKMeans
public SimpleKMeans()
globalInfo
public java.lang.String globalInfo()
Returns a string describing this clusterer
buildClusterer
public void buildClusterer(Instances data) throws java.lang.Exception
Generates a clusterer. Has to initialize all fields of the clusterer
that are not being set via options.
data
- set of instances serving as training 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() throws java.lang.Exception
Returns the number of clusters.
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.
Specify the number of clusters to generate. If omitted,
EM will use cross validation to select the number of clusters
automatically.
Specify random number seed.
numClustersTipText
public java.lang.String numClustersTipText()
Returns the tip text for this property
setNumClusters
public void setNumClusters(int n)
set the number of clusters to generate
n
- the number of clusters to generate
getNumClusters
public int getNumClusters()
gets the number of clusters to generate
seedTipText
public java.lang.String seedTipText()
Returns the tip text for this property
setSeed
public void setSeed(int s)
Set the random number seed
s
- the seed
getSeed
public int getSeed()
Get 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 the following arguments:
All Packages Class Hierarchy This Package Previous Next Index WEKA's home