public class SumOfSqrdPairwiseDistances extends Object implements IntraClusterEvaluation
EuclideanDistance
is a special case, and takes only O(n) work.Constructor and Description |
---|
SumOfSqrdPairwiseDistances()
Creates a new evaluator that uses the Euclidean distance
|
SumOfSqrdPairwiseDistances(DistanceMetric dm)
Creates a new cluster evaluator using the given distance metric
|
SumOfSqrdPairwiseDistances(SumOfSqrdPairwiseDistances toCopy)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
SumOfSqrdPairwiseDistances |
clone() |
double |
evaluate(int[] designations,
DataSet dataSet,
int clusterID)
Evaluates the cluster represented by the given list of data points.
|
double |
evaluate(List<DataPoint> dataPoints)
Evaluates the cluster represented by the given list of data points.
|
DistanceMetric |
getDistanceMetric() |
void |
setDistanceMetric(DistanceMetric dm)
Sets the distance metric to be used whenever this object is called to
evaluate a cluster
|
public SumOfSqrdPairwiseDistances()
public SumOfSqrdPairwiseDistances(DistanceMetric dm)
dm
- the distance metric to usepublic SumOfSqrdPairwiseDistances(SumOfSqrdPairwiseDistances toCopy)
toCopy
- the object to copypublic void setDistanceMetric(DistanceMetric dm)
dm
- the distance metric to usepublic DistanceMetric getDistanceMetric()
public double evaluate(int[] designations, DataSet dataSet, int clusterID)
IntraClusterEvaluation
evaluate
in interface IntraClusterEvaluation
designations
- the array of cluster designations for the data setdataSet
- the full data set of all clustersclusterID
- the cluster id in the designations array to
return the evaluation ofpublic double evaluate(List<DataPoint> dataPoints)
IntraClusterEvaluation
evaluate
in interface IntraClusterEvaluation
dataPoints
- the data points that make up this clusterpublic SumOfSqrdPairwiseDistances clone()
clone
in interface IntraClusterEvaluation
clone
in class Object
Copyright © 2017. All rights reserved.