public class FarthestFirst extends RandomizableClusterer implements TechnicalInformationHandler
@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 FormConstructor and Description |
---|
FarthestFirst() |
Modifier and Type | Method and Description |
---|---|
void |
buildClusterer(Instances data)
Generates a clusterer.
|
int |
clusterInstance(Instance instance)
Classifies a given instance.
|
Capabilities |
getCapabilities()
Returns default capabilities of the clusterer.
|
Instances |
getClusterCentroids()
Get the centroids found by FarthestFirst
|
int |
getNumClusters()
gets the number of clusters to generate
|
java.lang.String[] |
getOptions()
Gets the current settings of FarthestFirst
|
java.lang.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.
|
java.lang.String |
globalInfo()
Returns a string describing this clusterer
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
int |
numberOfClusters()
Returns the number of clusters.
|
java.lang.String |
numClustersTipText()
Returns the tip text for this property
|
void |
setNumClusters(int n)
set the number of clusters to generate
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
return a string describing this clusterer
|
getSeed, seedTipText, setSeed
debugTipText, distributionForInstance, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, postExecution, preExecution, run, runClusterer, setDebug, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClusterer
Capabilities
public void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
data
- set of instances serving as training datajava.lang.Exception
- if the clusterer has not been generated successfullypublic int clusterInstance(Instance instance) throws java.lang.Exception
clusterInstance
in interface Clusterer
clusterInstance
in class AbstractClusterer
instance
- the instance to be assigned to a clusterjava.lang.Exception
- if instance could not be classified successfullypublic int numberOfClusters() throws java.lang.Exception
numberOfClusters
in interface Clusterer
numberOfClusters
in class AbstractClusterer
java.lang.Exception
- if number of clusters could not be returned successfullypublic Instances getClusterCentroids()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableClusterer
public java.lang.String numClustersTipText()
public void setNumClusters(int n) throws java.lang.Exception
n
- the number of clusters to generatejava.lang.Exception
- if number of clusters is negativepublic int getNumClusters()
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-N <num> number of clusters. (default = 2).
-S <num> Random number seed. (default 1)
setOptions
in interface OptionHandler
setOptions
in class RandomizableClusterer
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class RandomizableClusterer
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments:
-t training file [-N number of clusters]