Package 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 aNeighborEvaluator
.- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
Clusterer
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected NeighborEvaluator
evaluator
-
Constructor Summary
Constructors Constructor Description HillClimbingClusterer(Pipe instancePipe, NeighborEvaluator evaluator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Clustering
cluster(InstanceList instances)
While not converged, callsimproveClustering
to modify the current predictedClustering
.Clustering
cluster(InstanceList instances, int iterations, Clustering initialClustering)
While not converged, callimproveClustering
to modify the current predictedClustering
.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.
-
-
-
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, callsimproveClustering
to modify the current predictedClustering
.- Specified by:
cluster
in classClusterer
- Parameters:
instances
-- Returns:
- The predicted
Clustering
.
-
clusterKBest
public Clustering[] clusterKBest(InstanceList instances, int k)
- Specified by:
clusterKBest
in classKBestClusterer
-
cluster
public Clustering cluster(InstanceList instances, int iterations, Clustering initialClustering)
While not converged, callimproveClustering
to modify the current predictedClustering
.- 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.
-
-