Class ClusteringFeature


  • public class ClusteringFeature
    extends java.lang.Object
    Clustering Feature of BIRCH
    Since:
    0.7.5
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double[] ls
      Linear sum.
      (package private) int n
      Number of objects
      (package private) double ss
      Sum of squares (see original thesis, this is a scalar).
    • Constructor Summary

      Constructors 
      Constructor Description
      ClusteringFeature​(int dimensionality)
      Constructor.
    • Field Detail

      • n

        int n
        Number of objects
      • ls

        double[] ls
        Linear sum.
      • ss

        double ss
        Sum of squares (see original thesis, this is a scalar).
    • Constructor Detail

      • ClusteringFeature

        public ClusteringFeature​(int dimensionality)
        Constructor.
        Parameters:
        dimensionality - Dimensionality
    • Method Detail

      • addToStatistics

        protected void addToStatistics​(NumberVector nv)
        Add a number vector to the current node.
        Parameters:
        nv - Vector to add
      • addToStatistics

        protected void addToStatistics​(ClusteringFeature other)
        Merge an other clustering features.
        Parameters:
        other - Other CF
      • resetStatistics

        protected void resetStatistics()
        Reset the CF to zero. For use in splitting.
      • centroid

        public double centroid​(int i)
        Centroid value in dimension i.
        Parameters:
        i - Dimension
        Returns:
        Average, or zero
      • sumOfSumOfSquares

        public double sumOfSumOfSquares()
        Sum over all dimensions of sums of squares.
        Returns:
        Sum of SS
      • sumOfSquaresOfSums

        public double sumOfSquaresOfSums()
        Sum over all dimensions of squares of linear sums.
        Returns:
        Sum of LS
      • getDimensionality

        public int getDimensionality()
        Dimensionality of the clustering feature.
        Returns:
        Dimensionality
      • sumOfSquares

        public static double sumOfSquares​(NumberVector v)
        Compute the sum of squares of a vector.
        Parameters:
        v - Vector
        Returns:
        Sum of squares