org.apache.mahout.clustering.meanshift
Class MeanShiftCanopyClusterer
java.lang.Object
org.apache.mahout.clustering.meanshift.MeanShiftCanopyClusterer
public class MeanShiftCanopyClusterer
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MeanShiftCanopyClusterer
public MeanShiftCanopyClusterer(org.apache.hadoop.conf.Configuration configuration)
MeanShiftCanopyClusterer
public MeanShiftCanopyClusterer(DistanceMeasure aMeasure,
double aT1,
double aT2,
double aDelta)
getT1
public double getT1()
getT2
public double getT2()
mergeCanopy
public void mergeCanopy(MeanShiftCanopy aCanopy,
java.util.Collection<MeanShiftCanopy> canopies)
- Merge the given canopy into the canopies list. If it touches any existing canopy (norm
- Parameters:
aCanopy
- a MeanShiftCanopy to be mergedcanopies
- the List to be appended
shiftToMean
public boolean shiftToMean(MeanShiftCanopy canopy)
- Shift the center to the new centroid of the cluster
- Parameters:
canopy
- the canopy to shift.
- Returns:
- if the cluster is converged
closelyBound
public boolean closelyBound(MeanShiftCanopy canopy,
Vector point)
- Return if the point is closely covered by the canopy
- Parameters:
canopy
- a canopy.point
- a Vector point
- Returns:
- if the point is covered
clusterPoints
public static java.util.List<MeanShiftCanopy> clusterPoints(java.lang.Iterable<Vector> points,
DistanceMeasure measure,
double convergenceThreshold,
double t1,
double t2,
int numIter)
- This is the reference mean-shift implementation. Given its inputs it iterates over the points and
clusters until their centers converge or until the maximum number of iterations is exceeded.
- Parameters:
points
- the input List of pointsmeasure
- the DistanceMeasure to usenumIter
- the maximum number of iterations
iterate
protected java.util.List<MeanShiftCanopy> iterate(java.lang.Iterable<MeanShiftCanopy> canopies,
boolean[] converged)
verifyNonOverlap
protected static void verifyNonOverlap(java.lang.Iterable<MeanShiftCanopy> canopies)
findCoveringCanopy
protected static MeanShiftCanopy findCoveringCanopy(MeanShiftCanopy canopy,
java.lang.Iterable<MeanShiftCanopy> clusters)
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.