cc.mallet.cluster
Class HillClimbingClusterer

java.lang.Object
  extended by cc.mallet.cluster.Clusterer
      extended by cc.mallet.cluster.KBestClusterer
          extended by cc.mallet.cluster.HillClimbingClusterer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GreedyAgglomerative

public abstract class HillClimbingClusterer
extends KBestClusterer

A Clusterer that iteratively improves a predicted Clustering using a NeighborEvaluator.

Since:
1.0
Version:
1.0
Author:
"Aron Culotta"
See Also:
Clusterer, Serialized Form

Field Summary
protected  NeighborEvaluator evaluator
           
 
Constructor Summary
HillClimbingClusterer(Pipe instancePipe, NeighborEvaluator evaluator)
           
 
Method Summary
 Clustering cluster(InstanceList instances)
          While not converged, calls improveClustering to modify the current predicted Clustering.
 Clustering cluster(InstanceList instances, int iterations, Clustering initialClustering)
          While not converged, call improveClustering to modify the current predicted Clustering.
 Clustering[] clusterKBest(InstanceList instances, int k)
           
 Clustering[] clusterKBest(InstanceList instances, int iterations, Clustering initialClustering, int k)
          Return the K most recent solutions.
abstract  boolean converged(Clustering clustering)
           
 NeighborEvaluator getEvaluator()
           
abstract  Clustering improveClustering(Clustering clustering)
           
abstract  Clustering initializeClustering(InstanceList instances)
           
abstract  void reset()
          Perform any cleanup of the clustering algorithm prior to clustering.
 
Methods inherited from class cc.mallet.cluster.Clusterer
getPipe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

evaluator

protected NeighborEvaluator evaluator
Constructor Detail

HillClimbingClusterer

public HillClimbingClusterer(Pipe instancePipe,
                             NeighborEvaluator evaluator)
Method Detail

getEvaluator

public NeighborEvaluator getEvaluator()

cluster

public Clustering cluster(InstanceList instances)
While not converged, calls improveClustering to modify the current predicted Clustering.

Specified by:
cluster in class Clusterer
Parameters:
instances -
Returns:
The predicted Clustering.

clusterKBest

public Clustering[] clusterKBest(InstanceList instances,
                                 int k)
Specified by:
clusterKBest in class KBestClusterer

cluster

public Clustering cluster(InstanceList instances,
                          int iterations,
                          Clustering initialClustering)
While not converged, call improveClustering to modify the current predicted Clustering.

Parameters:
instances - Instances to cluster.
iterations - Maximum number of iterations.
initialClustering - Initial clustering of the Instances.
Returns:
The predicted Clustering

clusterKBest

public Clustering[] clusterKBest(InstanceList instances,
                                 int iterations,
                                 Clustering initialClustering,
                                 int k)
Return the K most recent solutions.

Parameters:
instances -
iterations -
initialClustering -
Returns:

converged

public abstract boolean converged(Clustering clustering)
Parameters:
clustering -
Returns:
True if clustering is complete.

improveClustering

public abstract Clustering improveClustering(Clustering clustering)
Parameters:
clustering -
Returns:
A modified Clustering.

initializeClustering

public abstract Clustering initializeClustering(InstanceList instances)
Parameters:
instances -
Returns:
An initialized Clustering of these Instances.

reset

public abstract void reset()
Perform any cleanup of the clustering algorithm prior to clustering.