org.apache.mahout.clustering.evaluation
Class ClusterEvaluator

java.lang.Object
  extended by 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> of representative points keyed by clusterId
clusters - a Map 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

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-2012 The Apache Software Foundation. All Rights Reserved.