public abstract class AbstractClusterer extends Object implements Clusterer, Cloneable, Serializable, CapabilitiesHandler, RevisionHandler
Constructor and Description |
---|
AbstractClusterer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
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.
|
static Clusterer |
forName(String clustererName,
String[] options)
Creates a new instance of a clusterer given it's class name and
(optional) arguments to pass to it's setOptions method.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this clusterer.
|
String |
getRevision()
Returns the revision string.
|
static Clusterer[] |
makeCopies(Clusterer model,
int num)
Creates copies of the current clusterer.
|
static Clusterer |
makeCopy(Clusterer model)
Creates a deep copy of the given clusterer using serialization.
|
abstract int |
numberOfClusters()
Returns the number of clusters.
|
static void |
runClusterer(Clusterer clusterer,
String[] options)
runs the clusterer instance with the given options.
|
public abstract void buildClusterer(Instances data) throws Exception
buildClusterer
in interface Clusterer
data
- set of instances serving as training dataException
- if the clusterer has not been
generated successfullypublic int clusterInstance(Instance instance) throws Exception
clusterInstance
in interface Clusterer
instance
- the instance to be assigned to a clusterException
- if instance could not be clustered
successfullypublic double[] distributionForInstance(Instance instance) throws Exception
distributionForInstance
in interface Clusterer
instance
- the instance to be assigned a cluster.Exception
- if distribution could not be
computed successfullypublic abstract int numberOfClusters() throws Exception
numberOfClusters
in interface Clusterer
Exception
- if number of clusters could not be returned
successfullypublic static Clusterer forName(String clustererName, String[] options) throws Exception
clustererName
- the fully qualified class name of the clustereroptions
- an array of options suitable for passing to setOptions. May
be null.Exception
- if the clusterer class name is invalid, or the
options supplied are not acceptable to the clusterer.public static Clusterer makeCopy(Clusterer model) throws Exception
model
- the clusterer to copyException
- if an error occurspublic static Clusterer[] makeCopies(Clusterer model, int num) throws Exception
model
- an example clusterer to copynum
- the number of clusterer copies to create.Exception
- if an error occurspublic Capabilities getCapabilities()
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
Capabilities
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.