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.
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 |
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 Vectorid
- an int canopy idmeasure
- a DistanceMeasure
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.