## 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"
`Map<Integer,Vector>` `interClusterDistances()` Computes the inter-cluster distances
`Vector` `intraClusterDensities()` Computes the intra-cluster densities for all clusters as the average distance of the representative points from each other
`double` `intraClusterDensity()` Computes the average intra-cluster density as the average of each cluster's intra-cluster density

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)

  Initialize a new instance from job information

  Parameters:
    `conf` - a Configuration with appropriate parameters
    `clustersIn` - a String path to the input clusters directory

Method Detail

### interClusterDensity

    public double interClusterDensity()

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

  Returns:
    the interClusterDensity

### interClusterDistances

    public Map<Integer,Vector> interClusterDistances()

  Computes the inter-cluster distances

  Returns:
    a Map<Integer, Vector>

### intraClusterDensity

    public double intraClusterDensity()

  Computes the average intra-cluster density as the average of each cluster's intra-cluster density

  Returns:
    the average intraClusterDensity

### intraClusterDensities

    public Vector intraClusterDensities()

  Computes the intra-cluster densities for all clusters as the average distance of the representative points from each other

  Returns:
    a Vector of the intraClusterDensity of the representativePoints by clusterId

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.