|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcc.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 Form| Field 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 HillClimbingClustererinstances -
public boolean converged(Clustering clustering)
converged in class HillClimbingClustererpublic void reset()
reset in class HillClimbingClustererpublic 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 HillClimbingClustererclustering -
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 | |||||||||