|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.pivotselection.AbstractPivotChooser
messif.pivotselection.KMeansPivotChooser
public class KMeansPivotChooser
This class uses the k-means algorithm adapted for metric spaces to cluster the objects
Nested Class Summary | |
---|---|
protected class |
KMeansPivotChooser.SelectClustroidThread
Internal thread for selecting the "center" of a cluster. |
Field Summary | |
---|---|
protected AbstractObjectList<LocalAbstractObject> |
initialPivots
List of initial pivots |
static int |
MAX_ITERATIONS
Maximal number of iterations to let run |
static float |
PIVOTS_DISTINCTION_THRESHOLD
Threshold to consider 2 pivots the same |
static int |
PIVOTS_SAMPLE_SIZE
Size of the sample set to select a pivot from in each iteration of the k-means |
Fields inherited from class messif.pivotselection.AbstractPivotChooser |
---|
counterBucketReadBuckets, counterObjectDistComp, counterPivotDistComp, counterPivotReadBuckets, preselectedPivots, sampleProviders |
Constructor Summary | |
---|---|
KMeansPivotChooser()
Creates a new instance of KMeansPivotChooser with empty initial list of pivots. |
|
KMeansPivotChooser(AbstractObjectList<LocalAbstractObject> initialPivots)
Creates a new instance of KMeansPivotChooser. |
Method Summary | |
---|---|
void |
printPivots(java.lang.String msg)
Prints all pivots selected by this chooser. |
protected void |
selectPivot(int count,
AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
This method only uses the preselected pivots as initial pivots for k-means and rewrites the pivots completely |
Methods inherited from class messif.pivotselection.AbstractPivotChooser |
---|
addPivot, clear, deregisterSampleProvider, getLastPivot, getNextPivot, getPivot, getPivot, iterator, registerSampleProvider, removeLastPivot, selectPivot, selectPivot, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PIVOTS_SAMPLE_SIZE
public static final float PIVOTS_DISTINCTION_THRESHOLD
public static final int MAX_ITERATIONS
protected AbstractObjectList<LocalAbstractObject> initialPivots
Constructor Detail |
---|
public KMeansPivotChooser()
public KMeansPivotChooser(AbstractObjectList<LocalAbstractObject> initialPivots)
initialPivots
- the list of initial pivotsMethod Detail |
---|
protected void selectPivot(int count, AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
selectPivot
in class AbstractPivotChooser
count
- Number of pivots to generatesampleSetIterator
- Iterator over the sample set of objects to choose new pivots frompublic void printPivots(java.lang.String msg)
System.err
.
msg
- optional message printed before the pivots
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |