org.apache.mahout.clustering
Interface Cluster

All Superinterfaces:
Model<VectorWritable>, org.apache.hadoop.io.Writable
All Known Implementing Classes:
AbstractCluster, AsymmetricSampledNormalModel, Canopy, Cluster, DirichletCluster, DistanceMeasureCluster, GaussianCluster, L1Model, MeanShiftCanopy, NormalModel, SampledNormalModel, SoftCluster

public interface Cluster
extends Model<VectorWritable>

Implementations of this interface have a printable representation and certain attributes that are common across all clustering implementations


Field Summary
static java.lang.String CLUSTERED_POINTS_DIR
           
static java.lang.String CLUSTERS_DIR
           
static java.lang.String INITIAL_CLUSTERS_DIR
           
 
Method Summary
 java.lang.String asFormatString(java.lang.String[] bindings)
          Produce a custom, human-friendly, printable representation of the Cluster.
 java.lang.String asJsonString()
          Produce a textual representation of the Cluster using Json format.
 Vector getCenter()
          Get the "center" of the Cluster as a Vector
 int getId()
          Get the id of the Cluster
 int getNumPoints()
          Get an integer denoting the number of points observed by this cluster
 Vector getRadius()
          Get the "radius" of the Cluster as a Vector.
 
Methods inherited from interface org.apache.mahout.clustering.Model
computeParameters, count, observe, pdf, sampleFromPosterior
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Field Detail

CLUSTERED_POINTS_DIR

static final java.lang.String CLUSTERED_POINTS_DIR
See Also:
Constant Field Values

INITIAL_CLUSTERS_DIR

static final java.lang.String INITIAL_CLUSTERS_DIR
See Also:
Constant Field Values

CLUSTERS_DIR

static final java.lang.String CLUSTERS_DIR
See Also:
Constant Field Values
Method Detail

getId

int getId()
Get the id of the Cluster

Returns:
a unique integer

getCenter

Vector getCenter()
Get the "center" of the Cluster as a Vector

Returns:
a Vector

getRadius

Vector getRadius()
Get the "radius" of the Cluster as a Vector. Usually the radius is the standard deviation expressed as a Vector of size equal to the center. Some clusters may return zero values if not appropriate.

Returns:
aVector

getNumPoints

int getNumPoints()
Get an integer denoting the number of points observed by this cluster

Returns:
an integer

asFormatString

java.lang.String asFormatString(java.lang.String[] bindings)
Produce a custom, human-friendly, printable representation of the Cluster.

Parameters:
bindings - an optional String[] containing labels used to format the primary Vector/s of this implementation.
Returns:
a String

asJsonString

java.lang.String asJsonString()
Produce a textual representation of the Cluster using Json format. (Label bindings are transient and not part of the Json representation)

Returns:
a Json String


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