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

Constructor Summary
DistributionClusterer()
           
 
Method Summary
 int clusterInstance(Instance instance)
          Assigns an instance to a Cluster.
abstract  double densityForInstance(Instance instance)
          Computes the density for a given instance.
abstract  double[] distributionForInstance(Instance instance)
          Predicts the cluster memberships for a given instance.
 
Methods inherited from class weka.clusterers.Clusterer
buildClusterer, forName, makeCopies, numberOfClusters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributionClusterer

public DistributionClusterer()
Method Detail

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