org.apache.mahout.clustering.meanshift
Class MeanShiftCanopyClusterer
java.lang.Object
org.apache.mahout.clustering.meanshift.MeanShiftCanopyClusterer
public class MeanShiftCanopyClusterer
- extends Object
Method Summary |
boolean |
closelyBound(MeanShiftCanopy canopy,
Vector point)
Return if the point is closely covered by the canopy |
static List<MeanShiftCanopy> |
clusterPoints(Iterable<Vector> points,
DistanceMeasure measure,
IKernelProfile aKernelProfileDerivative,
double convergenceThreshold,
double t1,
double t2,
int numIter)
This is the reference mean-shift implementation. |
protected static MeanShiftCanopy |
findCoveringCanopy(MeanShiftCanopy canopy,
Iterable<MeanShiftCanopy> clusters)
|
double |
getT1()
|
double |
getT2()
|
protected List<MeanShiftCanopy> |
iterate(Iterable<MeanShiftCanopy> canopies,
boolean[] converged)
|
void |
mergeCanopy(MeanShiftCanopy aCanopy,
Collection<MeanShiftCanopy> canopies)
Merge the given canopy into the canopies list. |
boolean |
shiftToMean(MeanShiftCanopy canopy)
Shift the center to the new centroid of the cluster |
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,
IKernelProfile aKernelProfileDerivative,
double aT1,
double aT2,
double aDelta,
boolean runClustering)
getT1
public double getT1()
getT2
public double getT2()
mergeCanopy
public void mergeCanopy(MeanShiftCanopy aCanopy,
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 List<MeanShiftCanopy> clusterPoints(Iterable<Vector> points,
DistanceMeasure measure,
IKernelProfile aKernelProfileDerivative,
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 List<MeanShiftCanopy> iterate(Iterable<MeanShiftCanopy> canopies,
boolean[] converged)
findCoveringCanopy
protected static MeanShiftCanopy findCoveringCanopy(MeanShiftCanopy canopy,
Iterable<MeanShiftCanopy> clusters)
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.