weka.clusterers
Class DistributionClusterer
java.lang.Object
|
+--weka.clusterers.Clusterer
|
+--weka.clusterers.DistributionClusterer
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- DistributionMetaClusterer, EM
- public abstract class DistributionClusterer
- extends Clusterer
Abstract clustering model that produces (for each test instance)
an estimate of the membership in each cluster
(ie. a probability distribution).
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributionClusterer
public DistributionClusterer()
densityForInstance
public abstract double densityForInstance(Instance instance)
throws java.lang.Exception
- Computes the density for a given instance.
- Parameters:
instance
- the instance to compute the density for- Returns:
- the density.
- Throws:
java.lang.Exception
- if the density could not be computed
successfully
distributionForInstance
public abstract double[] distributionForInstance(Instance instance)
throws java.lang.Exception
- Predicts the cluster memberships for a given instance.
- 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:
java.lang.Exception
- if distribution could not be
computed successfully
clusterInstance
public int clusterInstance(Instance instance)
throws java.lang.Exception
- Assigns an instance to a Cluster.
- Overrides:
clusterInstance
in class Clusterer
- Parameters:
instance
- the instance to be classified- Returns:
- the predicted most likely cluster for the instance.
- Throws:
java.lang.Exception
- if an error occurred during the prediction