Class ClusteringTreeNode

  • All Implemented Interfaces:
    Serializable, MOAObject
    Direct Known Subclasses:
    ClusteringTreeHeadNode

    public class ClusteringTreeNode
    extends AbstractMOAObject
    Provides a tree of ClusterFeatures. Citation: Hendrik Fichtenberger, Marc Gillé, Melanie Schmidt, Chris Schwiegelshohn, Christian Sohler: BICO: BIRCH Meets Coresets for k-Means Clustering. ESA 2013: 481-492 (2013) http://ls2-www.cs.tu-dortmund.de/bico/
    See Also:
    Serialized Form
    • Constructor Detail

      • ClusteringTreeNode

        public ClusteringTreeNode​(double[] center,
                                  ClusteringFeature cf)
        Creates a tree node for a ClusterFeature.
        Parameters:
        center - representation of the ClusterFeature
        cf - the ClusterFeature
    • Method Detail

      • count

        @Deprecated
        public int count()
        Deprecated.
        Counts the elements in tree with this node as the root.
        Returns:
        the number of elements
      • addToClustering

        public Clustering addToClustering​(Clustering clustering)
        Adds all ClusterFeatures of the tree with this node as the root to a Clustering.
        Parameters:
        clustering - the Clustering to add the ClusterFeatures too.
        Returns:
        the input Clustering
      • addToClusteringCenters

        public List<double[]> addToClusteringCenters​(List<double[]> clustering)
        Adds all clustering centers of the ClusterFeatures of the tree with this node as the root to a List of points.
        Parameters:
        clustering - the List to add the clustering centers too.
        Returns:
        the input List
      • printClusteringCenters

        public void printClusteringCenters​(Writer stream)
                                    throws IOException
        Writes all clustering centers of the ClusterFeatures of the tree with this node as the root to a given stream.
        Parameters:
        stream - the stream
        Throws:
        IOException - If an I/O error occurs
      • getCenter

        public double[] getCenter()
        Gets the representation of the ClusteringFeature
        Returns:
        the representation of the ClusteringFeature
      • setCenter

        public void setCenter​(double[] center)
        Sets the representation of the ClusteringFeature
        Parameters:
        center - the representation of the ClusteringFeature to set
      • getClusteringFeature

        public ClusteringFeature getClusteringFeature()
        Gets the ClusteringFeature of this node.
        Returns:
        the ClusteringFeature
      • getChildren

        public List<ClusteringTreeNode> getChildren()
        Gets a List of the children nodes.
        Returns:
        a List of the children nodes
      • getDescription

        public void getDescription​(StringBuilder sb,
                                   int indent)
        Description copied from interface: MOAObject
        Returns a string representation of this object. Used in AbstractMOAObject.toString to give a string representation of the object.
        Parameters:
        sb - the stringbuilder to add the description
        indent - the number of characters to indent
      • nearestChild

        public ClusteringTreeNode nearestChild​(double[] pointA)
        Searches for the nearest child node by comparing each representation.
        Parameters:
        pointA - to find the nearest child for
        Returns:
        the child node which is the nearest
      • clearChildren

        public void clearChildren()
        Removes all children nodes.
        See Also:
        List.clear()
      • hasNoChildren

        public boolean hasNoChildren()
        Returns true if this node contains no children nodes.
        Returns:
        true if this node contains no children nodes
        See Also:
        List.isEmpty()
      • getThreshold

        public double getThreshold()
        Gets the threshold of this node.
        Returns:
        the threshold
      • setThreshold

        public void setThreshold​(double threshold)
        Gets the threshold of this node.
        Parameters:
        threshold - the threshold to set