|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.clusterers.AbstractClusterer
weka.clusterers.RandomizableClusterer
edu.georgetown.gucs.clustering.ClusterPrunerWeka
public class ClusterPrunerWeka
Cluster pruner using WEKA's classes
Field Summary | |
---|---|
protected weka.core.DistanceFunction |
m_DistanceFunction
the distance function used. |
Fields inherited from class weka.clusterers.RandomizableClusterer |
---|
m_Seed, m_SeedDefault |
Constructor Summary | |
---|---|
ClusterPrunerWeka()
Default constructor. |
Method Summary | |
---|---|
void |
buildClusterer(weka.core.Instances instances)
Builds this leader clusterer using the specified instances. |
int |
clusterInstance(weka.core.Instance instance)
Clusters the specified instance. |
int[] |
getAssignments()
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the clusterer. |
weka.core.DistanceFunction |
getDistanceFunction()
returns the distance function currently in use. |
int |
getK()
|
weka.core.Instances |
getLeaders()
Gets the number of leaders |
int |
getNumberOfFollowers()
|
int |
getNumClusters()
Gets the number of clusters |
java.lang.String[] |
getOptions()
Gets the current settings of ClusterPrunerWeka |
java.lang.String |
globalInfo()
Returns a string describing this clusterer |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
int |
numberOfClusters()
Returns the number of clusters. |
weka.core.Instances |
retrieve(weka.core.Instance instance)
Retrieves the top k instances based on the specified instance or query. |
void |
setDistanceFunction(weka.core.DistanceFunction df)
sets the distance function to use for instance comparison. |
void |
setK(int k)
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setPreserveInstancesOrder(boolean r)
|
java.lang.String |
toString()
return a string describing this clusterer |
Methods inherited from class weka.clusterers.RandomizableClusterer |
---|
getSeed, seedTipText, setSeed |
Methods inherited from class weka.clusterers.AbstractClusterer |
---|
distributionForInstance, forName, getRevision, makeCopies, makeCopy, runClusterer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected weka.core.DistanceFunction m_DistanceFunction
Constructor Detail |
---|
public ClusterPrunerWeka()
Method Detail |
---|
public void buildClusterer(weka.core.Instances instances) throws java.lang.Exception
buildClusterer
in interface weka.clusterers.Clusterer
buildClusterer
in class weka.clusterers.AbstractClusterer
instances
- the instances to cluster
java.lang.Exception
- if the clusterer has not been
generated successfullypublic int clusterInstance(weka.core.Instance instance) throws java.lang.Exception
clusterInstance
in interface weka.clusterers.Clusterer
clusterInstance
in class weka.clusterers.AbstractClusterer
instance
- the instance to be assigned to a cluster
java.lang.Exception
- if instance could not be clusteredpublic weka.core.Instances retrieve(weka.core.Instance instance) throws java.lang.Exception
instance
- the specified instance or query
java.lang.Exception
- if something goes wrongpublic weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.clusterers.Clusterer
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.clusterers.AbstractClusterer
public java.lang.String globalInfo()
public int numberOfClusters() throws java.lang.Exception
numberOfClusters
in interface weka.clusterers.Clusterer
numberOfClusters
in class weka.clusterers.AbstractClusterer
java.lang.Exception
- if number of clusters could not be returned
successfullypublic int getNumClusters()
public weka.core.DistanceFunction getDistanceFunction()
public void setDistanceFunction(weka.core.DistanceFunction df) throws java.lang.Exception
df
- the new distance function to use
java.lang.Exception
- if instances cannot be processedpublic int getNumberOfFollowers()
public void setK(int k) throws java.lang.Exception
java.lang.Exception
public int getK()
public void setPreserveInstancesOrder(boolean r)
public int[] getAssignments()
public weka.core.Instances getLeaders()
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.clusterers.RandomizableClusterer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.clusterers.RandomizableClusterer
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class weka.clusterers.RandomizableClusterer
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- should contain the following arguments: -t training file [-N number of clusters]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |