cc.mallet.cluster
Class GreedyAgglomerativeByDensity
java.lang.Object
cc.mallet.cluster.Clusterer
cc.mallet.cluster.KBestClusterer
cc.mallet.cluster.HillClimbingClusterer
cc.mallet.cluster.GreedyAgglomerative
cc.mallet.cluster.GreedyAgglomerativeByDensity
- All Implemented Interfaces:
- java.io.Serializable
public class GreedyAgglomerativeByDensity
- extends GreedyAgglomerative
Greedily merges Instances until convergence. New merges are scored
using NeighborEvaluator
.
Differs from GreedyAgglomerative
in that one cluster is
created at a time. That is, nodes are added to a cluster until
convergence. Then, a new cluster is created from the remaining
nodes. This reduces the number of comparisons from O(n^2) to
O(nlg|n|).
- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
GreedyAgglomerative
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
GreedyAgglomerativeByDensity
public GreedyAgglomerativeByDensity(Pipe instancePipe,
NeighborEvaluator evaluator,
double stoppingThreshold,
boolean doPostConvergenceMerges,
java.util.Random random)
- Parameters:
instancePipe
- Pipe for each underying Instance
.evaluator
- To score potential merges.stoppingThreshold
- Clustering converges when the evaluator score is below this value.doPostConvergenceMerges
- If true, perform greedy
agglomerative clustering on the clusters at the end of
convergence. This may alleviate the greediness of the byDensity
clustering algorithm.
converged
public boolean converged(Clustering clustering)
- Overrides:
converged
in class GreedyAgglomerative
- Returns:
- True if clustering is complete.
reset
public void reset()
- Reset convergence to false and clear state so a new round of
clustering can begin.
- Overrides:
reset
in class GreedyAgglomerative
improveClustering
public Clustering improveClustering(Clustering clustering)
- Description copied from class:
GreedyAgglomerative
- For each pair of clusters, calculate the score of the
Neighbor
that would result from merging the two clusters. Choose the merge that
obtains the highest score. If no merge improves score, return original
Clustering
- Overrides:
improveClustering
in class GreedyAgglomerative
- Returns:
- A modified Clustering.
toString
public java.lang.String toString()
- Overrides:
toString
in class GreedyAgglomerative