Interface KMeansQualityMeasure<O extends NumberVector>

    • Method Detail

      • quality

        <V extends O> double quality​(Clustering<? extends MeanModel> clustering,
                                     NumberVectorDistance<? super V> distance,
                                     Relation<V> relation)
        Calculates and returns the quality measure.
        Type Parameters:
        V - Actual vector type (could be a subtype of O!)
        Parameters:
        clustering - Clustering to analyze
        distance - Distance function to use (usually Euclidean or squared Euclidean!)
        relation - Relation for accessing objects
        Returns:
        quality measure
      • isBetter

        boolean isBetter​(double currentCost,
                         double bestCost)
        Compare two scores.
        Parameters:
        currentCost - New (candiate) cost/score
        bestCost - Existing best cost/score (may be NaN)
        Returns:
        true when the new score is better, or the old score is NaN.