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>, Parametered
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.
Fields inherited from interface org.apache.mahout.common.parameters.Parametered |
log |
Methods inherited from class org.apache.mahout.clustering.AbstractCluster |
asFormatString, computeCentroid, computeParameters, count, createParameters, formatVector, getCenter, getId, getNumPoints, getObservations, getParameters, getRadius, getS0, getS1, getS2, observe, observe, observe, observe, observe, observe, setCenter, setId, setNumPoints, setRadius, setS0, setS1, setS2 |
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
getMass
public int getMass()
initialCanopy
public static MeanShiftCanopy initialCanopy(Vector point,
int id,
DistanceMeasure measure)
- Create an initial Canopy, retaining the original type of the given point
(e.g. NamedVector)
- Parameters:
point
- a Vectorid
- an intmeasure
- a DistanceMeasure
- Returns:
- a MeanShiftCanopy
getBoundPoints
public org.apache.mahout.math.list.IntArrayList getBoundPoints()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Overrides:
readFields
in class Cluster
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Overrides:
write
in class Cluster
- Throws:
IOException
shallowCopy
public MeanShiftCanopy shallowCopy()
asFormatString
public String asFormatString()
- Overrides:
asFormatString
in class Cluster
setBoundPoints
public void setBoundPoints(org.apache.mahout.math.list.IntArrayList boundPoints)
getIdentifier
public 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-2012 The Apache Software Foundation. All Rights Reserved.