## org.apache.mahout.clustering.meanshift
Class MeanShiftCanopyClusterer

    java.lang.Object
      org.apache.mahout.clustering.meanshift.MeanShiftCanopyClusterer

    public class MeanShiftCanopyClusterer

extends java.lang.Object

Constructor Summary
`MeanShiftCanopyClusterer(org.apache.hadoop.conf.Configuration configuration)`
`MeanShiftCanopyClusterer(DistanceMeasure aMeasure, double aT1, double aT2, double aDelta)`

Method Summary
`boolean` `closelyBound(MeanShiftCanopy canopy, Vector point)` Return if the point is closely covered by the canopy
`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.
`protected static MeanShiftCanopy` `findCoveringCanopy(MeanShiftCanopy canopy, java.lang.Iterable<MeanShiftCanopy> clusters)`
`double` `getT1()`
`double` `getT2()`
`protected java.util.List<MeanShiftCanopy>` `iterate(java.lang.Iterable<MeanShiftCanopy> canopies, boolean[] converged)`
`void` `mergeCanopy(MeanShiftCanopy aCanopy, java.util.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
`protected static void` `verifyNonOverlap(java.lang.Iterable<MeanShiftCanopy> canopies)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MeanShiftCanopyClusterer

    public MeanShiftCanopyClusterer(org.apache.hadoop.conf.Configuration configuration)

### MeanShiftCanopyClusterer

    public MeanShiftCanopyClusterer(DistanceMeasure aMeasure,
                                    double aT1,
                                    double aT2,
                                    double aDelta)

Method Detail

### 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<T1) then add the center of each to the other. If it covers any other canopies (norm<T2), then merge the given canopy with the closest covering canopy. If the given canopy does not cover any other canopies, add it to the canopies list.

  Parameters:
    `aCanopy` - a MeanShiftCanopy to be merged
    `canopies` - the List<Canopy> 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<Vector> of points
    `measure` - the DistanceMeasure to use
    `numIter` - 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.