|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.cluster.Clusterer cc.mallet.cluster.KBestClusterer cc.mallet.cluster.HillClimbingClusterer cc.mallet.cluster.GreedyAgglomerative
public class GreedyAgglomerative
Greedily merges Instances until convergence. New merges are scored
using NeighborEvaluator
.
HillClimbingClusterer
,
Serialized FormField Summary | |
---|---|
protected boolean |
converged
True if should stop clustering. |
protected PairwiseMatrix |
scoreCache
Cache for calls to NeighborhoodEvaluator . |
protected double |
stoppingThreshold
Converged when merge score is below this value. |
Fields inherited from class cc.mallet.cluster.HillClimbingClusterer |
---|
evaluator |
Constructor Summary | |
---|---|
GreedyAgglomerative(Pipe instancePipe,
NeighborEvaluator evaluator,
double stoppingThreshold)
|
Method Summary | |
---|---|
boolean |
converged(Clustering clustering)
|
protected double |
getScore(Clustering clustering,
int i,
int j)
|
Clustering |
improveClustering(Clustering clustering)
For each pair of clusters, calculate the score of the Neighbor
that would result from merging the two clusters. |
Clustering |
initializeClustering(InstanceList instances)
|
void |
reset()
Reset convergence to false so a new round of clustering can begin. |
java.lang.String |
toString()
|
protected void |
updateScoreMatrix(Clustering clustering,
int i,
int j)
Resets the values of clusters that have been merged. |
Methods inherited from class cc.mallet.cluster.HillClimbingClusterer |
---|
cluster, cluster, clusterKBest, clusterKBest, getEvaluator |
Methods inherited from class cc.mallet.cluster.Clusterer |
---|
getPipe |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double stoppingThreshold
protected boolean converged
protected PairwiseMatrix scoreCache
NeighborhoodEvaluator
. In some
experiments, reduced running time by nearly half.
Constructor Detail |
---|
public GreedyAgglomerative(Pipe instancePipe, NeighborEvaluator evaluator, double stoppingThreshold)
instancePipe
- Pipe for each underying Instance
.evaluator
- To score potential merges.stoppingThreshold
- Clustering converges when the evaluator score is below this value.Method Detail |
---|
public Clustering initializeClustering(InstanceList instances)
initializeClustering
in class HillClimbingClusterer
instances
-
public boolean converged(Clustering clustering)
converged
in class HillClimbingClusterer
public void reset()
reset
in class HillClimbingClusterer
public Clustering improveClustering(Clustering clustering)
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
improveClustering
in class HillClimbingClusterer
clustering
-
protected double getScore(Clustering clustering, int i, int j)
clustering
- i
- j
-
protected void updateScoreMatrix(Clustering clustering, int i, int j)
clustering
- i
- j
- public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |