org.apache.mahout.clustering.canopy
Class Canopy

java.lang.Object
  extended by org.apache.mahout.clustering.AbstractCluster
      extended by org.apache.mahout.clustering.DistanceMeasureCluster
          extended by org.apache.mahout.clustering.canopy.Canopy
All Implemented Interfaces:
org.apache.hadoop.io.Writable, Cluster, Model<VectorWritable>

public class Canopy
extends DistanceMeasureCluster

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
Canopy()
          Used for deserializaztion as a writable
Canopy(Vector center, int canopyId, DistanceMeasure measure)
          Create a new Canopy containing the given point and canopyId
 
Method Summary
 java.lang.String asFormatString()
           
 java.lang.String getIdentifier()
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.mahout.clustering.DistanceMeasureCluster
getMeasure, pdf, readFields, sampleFromPosterior, setMeasure, write
 
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

Canopy

public Canopy()
Used for deserializaztion as a writable


Canopy

public Canopy(Vector center,
              int canopyId,
              DistanceMeasure measure)
Create a new Canopy containing the given point and canopyId

Parameters:
center - a point in vector space
canopyId - an int identifying the canopy local to this process only
measure - a DistanceMeasure to use
Method Detail

asFormatString

public java.lang.String asFormatString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getIdentifier

public java.lang.String getIdentifier()
Overrides:
getIdentifier in class DistanceMeasureCluster


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