## org.apache.mahout.clustering.evaluation
Class ClusterEvaluator

    java.lang.Object
      org.apache.mahout.clustering.evaluation.ClusterEvaluator

    public class ClusterEvaluator

extends Object

Constructor Summary
`ClusterEvaluator(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path clustersIn)` Initialize a new instance from job information
`ClusterEvaluator(Map<Integer,List<VectorWritable>> representativePoints, List<Cluster> clusters, DistanceMeasure measure)` For testing only

Method Summary
`double` `interClusterDensity()` Computes the inter-cluster density as defined in "Mahout In Action"
`double` `intraClusterDensity()` Computes the intra-cluster density as the average distance of the representative points from each other

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ClusterEvaluator

    public ClusterEvaluator(Map<Integer,List<VectorWritable>> representativePoints,
                            List<Cluster> clusters,
                            DistanceMeasure measure)

  For testing only

  Parameters:
    `representativePoints` - a Map<Integer,List<VectorWritable>> of representative points keyed by clusterId
    `clusters` - a Map<Integer,Cluster> of the clusters keyed by clusterId
    `measure` - an appropriate DistanceMeasure

### ClusterEvaluator

    public ClusterEvaluator(org.apache.hadoop.conf.Configuration conf,
                            org.apache.hadoop.fs.Path clustersIn)
                     throws ClassNotFoundException,
                            InstantiationException,
                            IllegalAccessException,
                            IOException

  Initialize a new instance from job information

  Parameters:
    `conf` - a JobConf with appropriate parameters
    `clustersIn` - a String path to the input clusters directory
  Throws:
    `ClassNotFoundException`
    `InstantiationException`
    `IllegalAccessException`
    `IOException`

Method Detail

### interClusterDensity

    public double interClusterDensity()

  Computes the inter-cluster density as defined in "Mahout In Action"

  Returns:
    the interClusterDensity

### intraClusterDensity

    public double intraClusterDensity()

  Computes the intra-cluster density as the average distance of the representative points from each other

  Returns:
    the intraClusterDensity of the representativePoints

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