|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.clusterers.AbstractClusterer
weka.clusterers.RandomizableClusterer
weka.clusterers.FarthestFirst
public class FarthestFirst
Cluster data using the FarthestFirst algorithm.
For more information see:
Hochbaum, Shmoys (1985). A best possible heuristic for the k-center problem. Mathematics of Operations Research. 10(2):180-184.
Sanjoy Dasgupta: Performance Guarantees for Hierarchical Clustering. In: 15th Annual Conference on Computational Learning Theory, 351-363, 2002.
Notes:
- works as a fast simple approximate clusterer
- modelled after SimpleKMeans, might be a useful initializer for it
@article{Hochbaum1985,
author = {Hochbaum and Shmoys},
journal = {Mathematics of Operations Research},
number = {2},
pages = {180-184},
title = {A best possible heuristic for the k-center problem},
volume = {10},
year = {1985}
}
@inproceedings{Dasgupta2002,
author = {Sanjoy Dasgupta},
booktitle = {15th Annual Conference on Computational Learning Theory},
pages = {351-363},
publisher = {Springer},
title = {Performance Guarantees for Hierarchical Clustering},
year = {2002}
}
Valid options are:
-N <num> number of clusters. (default = 2).
-S <num> Random number seed. (default 1)
RandomizableClusterer,
Serialized Form| Constructor Summary | |
|---|---|
FarthestFirst()
|
|
| Method Summary | |
|---|---|
void |
buildClusterer(Instances data)
Generates a clusterer. |
int |
clusterInstance(Instance instance)
Classifies a given instance. |
Capabilities |
getCapabilities()
Returns default capabilities of the clusterer. |
int |
getNumClusters()
gets the number of clusters to generate |
String[] |
getOptions()
Gets the current settings of FarthestFirst |
String |
getRevision()
Returns the revision string. |
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. |
String |
globalInfo()
Returns a string describing this clusterer |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for testing this class. |
int |
numberOfClusters()
Returns the number of clusters. |
String |
numClustersTipText()
Returns the tip text for this property |
void |
setNumClusters(int n)
set the number of clusters to generate |
void |
setOptions(String[] options)
Parses a given list of options. |
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, makeCopies, makeCopy, runClusterer |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FarthestFirst()
| Method Detail |
|---|
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface ClusterergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClustererCapabilities
public void buildClusterer(Instances data)
throws Exception
buildClusterer in interface ClustererbuildClusterer in class AbstractClustererdata - set of instances serving as training data
Exception - if the clusterer has not been
generated successfully
public int clusterInstance(Instance instance)
throws Exception
clusterInstance in interface ClustererclusterInstance in class AbstractClustererinstance - the instance to be assigned to a cluster
Exception - if instance could not be classified
successfully
public int numberOfClusters()
throws Exception
numberOfClusters in interface ClusterernumberOfClusters in class AbstractClustererException - if number of clusters could not be returned
successfullypublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class RandomizableClustererpublic String numClustersTipText()
public void setNumClusters(int n)
throws Exception
n - the number of clusters to generate
Exception - if number of clusters is negativepublic int getNumClusters()
public void setOptions(String[] options)
throws Exception
-N <num> number of clusters. (default = 2).
-S <num> Random number seed. (default 1)
setOptions in interface OptionHandlersetOptions in class RandomizableClustereroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class RandomizableClustererpublic String toString()
toString in class Objectpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClustererpublic static void main(String[] argv)
argv - 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 | |||||||||