## org.apache.mahout.clustering
Class DistanceMeasureCluster

    java.lang.Object
      org.apache.mahout.clustering.AbstractCluster
          org.apache.mahout.clustering.DistanceMeasureCluster

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

Direct Known Subclasses:
  Canopy, Cluster

    public class DistanceMeasureCluster

extends AbstractCluster

Field Summary
`protected DistanceMeasure` `measure`

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

Constructor Summary
`DistanceMeasureCluster()`
`DistanceMeasureCluster(Vector point, int id, DistanceMeasure measure)`

Method Summary
`java.lang.String` `getIdentifier()`
`DistanceMeasure` `getMeasure()`
`double` `pdf(VectorWritable vw)` Return the probability that the observation is described by this model
`void` `readFields(java.io.DataInput in)`
`Model<VectorWritable>` `sampleFromPosterior()`
`void` `setMeasure(DistanceMeasure measure)`
`void` `write(java.io.DataOutput out)`

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, toString, wait, wait, wait`

Field Detail

### measure

    protected DistanceMeasure measure

Constructor Detail

### DistanceMeasureCluster

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

### DistanceMeasureCluster

    public DistanceMeasureCluster()

Method Detail

### 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 `AbstractCluster`
  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 `AbstractCluster`
  Throws:
    `java.io.IOException`

### pdf

    public double pdf(VectorWritable vw)

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

  Parameters:
    `vw` - an Observation from the posterior
  Returns:
    the probability that x is in the receiver

### sampleFromPosterior

    public Model<VectorWritable> sampleFromPosterior()

  Returns:
    a sample of my posterior model

### getMeasure

    public DistanceMeasure getMeasure()

### setMeasure

    public void setMeasure(DistanceMeasure measure)

  Parameters:
    `measure` - the measure to set

### getIdentifier

    public java.lang.String getIdentifier()

  Specified by:
    `getIdentifier` in class `AbstractCluster`

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