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

    java.lang.Object
      org.apache.mahout.clustering.AbstractCluster
          org.apache.mahout.clustering.DistanceMeasureCluster
              org.apache.mahout.clustering.kmeans.Cluster
                  org.apache.mahout.clustering.meanshift.MeanShiftCanopy

All Implemented Interfaces:
  org.apache.hadoop.io.Writable, Cluster, Model<VectorWritable>

    public class MeanShiftCanopy

extends Cluster

This class models a canopy as a center point, the number of points that are contained within it according to the application of some distance metric, and a point total which is the sum of all the points and is used to compute the centroid when needed.

Field Summary

Fields inherited from class org.apache.mahout.clustering.DistanceMeasureCluster
`measure`

Fields inherited from interface org.apache.mahout.clustering.Cluster
`CLUSTERED_POINTS_DIR, CLUSTERS_DIR, INITIAL_CLUSTERS_DIR`

Constructor Summary
`MeanShiftCanopy()` Used for Writable
`MeanShiftCanopy(Vector point, int id, DistanceMeasure measure)` Create a new Canopy containing the given point

Method Summary
`java.lang.String` `asFormatString()`
`org.apache.mahout.math.list.IntArrayList` `getBoundPoints()`
`java.lang.String` `getIdentifier()`
`double` `pdf(VectorWritable vw)` Return the probability that the observation is described by this model
`void` `readFields(java.io.DataInput in)`
`void` `setBoundPoints(org.apache.mahout.math.list.IntArrayList boundPoints)`
`MeanShiftCanopy` `shallowCopy()`
`void` `write(java.io.DataOutput out)`

Methods inherited from class org.apache.mahout.clustering.kmeans.Cluster
`computeConvergence, formatCluster, isConverged, setConverged, toString`

Methods inherited from class org.apache.mahout.clustering.DistanceMeasureCluster
`getMeasure, sampleFromPosterior, setMeasure`

Methods inherited from class org.apache.mahout.clustering.AbstractCluster
`asFormatString, asJsonString, computeCentroid, computeParameters, count, formatVector, getCenter, getId, getNumPoints, getObservations, getRadius, getS0, getS1, getS2, observe, observe, observe, observe, setCenter, setId, setNumPoints, setRadius`

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

Constructor Detail

### MeanShiftCanopy

    public MeanShiftCanopy()

  Used for Writable

### MeanShiftCanopy

    public MeanShiftCanopy(Vector point,
                           int id,
                           DistanceMeasure measure)

  Create a new Canopy containing the given point

  Parameters:
    `point` - a Vector
    `id` - an int canopy id
    `measure` - a DistanceMeasure

Method Detail

### getBoundPoints

    public org.apache.mahout.math.list.IntArrayList getBoundPoints()

### readFields

    public void readFields(java.io.DataInput in)
                    throws java.io.IOException

  Specified by:
    `readFields` in interface `org.apache.hadoop.io.Writable`
  Overrides:
    `readFields` in class `Cluster`
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.DataOutput out)
               throws java.io.IOException

  Specified by:
    `write` in interface `org.apache.hadoop.io.Writable`
  Overrides:
    `write` in class `Cluster`
  Throws:
    `java.io.IOException`

### shallowCopy

    public MeanShiftCanopy shallowCopy()

### asFormatString

    public java.lang.String asFormatString()

  Overrides:
    `asFormatString` in class `Cluster`

### setBoundPoints

    public void setBoundPoints(org.apache.mahout.math.list.IntArrayList boundPoints)

### getIdentifier

    public java.lang.String getIdentifier()

  Overrides:
    `getIdentifier` in class `Cluster`

### pdf

    public double pdf(VectorWritable vw)

  Description copied from interface: `Model`
  Return the probability that the observation is described by this model

  Specified by:
    `pdf` in interface `Model<VectorWritable>`
  Overrides:
    `pdf` in class `DistanceMeasureCluster`
  Parameters:
    `vw` - an Observation from the posterior
  Returns:
    the probability that x is in the receiver

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.