cc.mallet.cluster
Class HillClimbingClusterer
java.lang.Object
cc.mallet.cluster.Clusterer
cc.mallet.cluster.KBestClusterer
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
evaluator
protected NeighborEvaluator evaluator
HillClimbingClusterer
public HillClimbingClusterer(Pipe instancePipe,
NeighborEvaluator evaluator)
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.