Package weka.clusterers
Interface Clusterer
- All Known Subinterfaces:
DensityBasedClusterer
- All Known Implementing Classes:
AbstractClusterer
,AbstractDensityBasedClusterer
,Canopy
,Cobweb
,EM
,FarthestFirst
,FilteredClusterer
,HierarchicalClusterer
,MakeDensityBasedClusterer
,RandomizableClusterer
,RandomizableDensityBasedClusterer
,RandomizableSingleClustererEnhancer
,SimpleKMeans
,SingleClustererEnhancer
public interface Clusterer
Interface for clusterers. Clients will typically extend either
AbstractClusterer or AbstractDensityBasedClusterer.
- Version:
- $Revision: 8034 $
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildClusterer
(Instances data) Generates a clusterer.int
clusterInstance
(Instance instance) Classifies a given instance.double[]
distributionForInstance
(Instance instance) Predicts the cluster memberships for a given instance.Returns the Capabilities of this clusterer.int
Returns the number of clusters.
-
Method Details
-
buildClusterer
Generates a clusterer. Has to initialize all fields of the clusterer that are not being set via options.- Parameters:
data
- set of instances serving as training data- Throws:
Exception
- if the clusterer has not been generated successfully
-
clusterInstance
Classifies a given instance. Either this or distributionForInstance() needs to be implemented by subclasses.- Parameters:
instance
- the instance to be assigned to a cluster- Returns:
- the number of the assigned cluster as an integer
- Throws:
Exception
- if instance could not be clustered successfully
-
distributionForInstance
Predicts the cluster memberships for a given instance. Either this or clusterInstance() needs to be implemented by subclasses.- Parameters:
instance
- the instance to be assigned a cluster.- Returns:
- an array containing the estimated membership probabilities of the test instance in each cluster (this should sum to at most 1)
- Throws:
Exception
- if distribution could not be computed successfully
-
numberOfClusters
Returns the number of clusters.- Returns:
- the number of clusters generated for a training dataset.
- Throws:
Exception
- if number of clusters could not be returned successfully
-
getCapabilities
Capabilities getCapabilities()Returns the Capabilities of this clusterer. Derived classifiers have to override this method to enable capabilities.- Returns:
- the capabilities of this object
- See Also:
-