Package moa.cluster

Class SphereCluster

    • Constructor Detail

      • SphereCluster

        public SphereCluster​(double[] center,
                             double radius)
      • SphereCluster

        public SphereCluster()
      • SphereCluster

        public SphereCluster​(double[] center,
                             double radius,
                             double weightedSize)
      • SphereCluster

        public SphereCluster​(int dimensions,
                             double radius,
                             Random random)
      • SphereCluster

        public SphereCluster​(List<? extends Instance> instances,
                             int dimension)
    • Method Detail

      • overlapRadiusDegree

        public double overlapRadiusDegree​(SphereCluster other)
        Checks whether two SphereCluster overlap based on radius NOTE: overlapRadiusDegree only calculates the overlap based on the centers and the radi, so not the real overlap TODO: should we do this by MC to get the real overlap???
        Parameters:
        other -
        Returns:
      • getCenter

        public double[] getCenter()
        Specified by:
        getCenter in class Cluster
        Returns:
        the center of the cluster
      • setCenter

        public void setCenter​(double[] center)
      • getRadius

        public double getRadius()
      • setRadius

        public void setRadius​(double radius)
      • getWeight

        public double getWeight()
        Description copied from class: Cluster
        Returns the weight of this cluster, not neccessarily normalized. It could, for instance, simply return the number of points contined in this cluster.
        Specified by:
        getWeight in class Cluster
        Returns:
        the weight
      • setWeight

        public void setWeight​(double weight)
      • getInclusionProbability

        public double getInclusionProbability​(Instance instance)
        Description copied from class: Cluster
        Returns the probability of the given point belonging to this cluster.
        Specified by:
        getInclusionProbability in class Cluster
        Returns:
        a value between 0 and 1
      • getCenterDistance

        public double getCenterDistance​(Instance instance)
      • getCenterDistance

        public double getCenterDistance​(SphereCluster other)
      • getHullDistance

        public double getHullDistance​(SphereCluster other)
      • overlapSave

        public boolean overlapSave​(SphereCluster other)
        When a clusters looses points the new minimal bounding sphere can be partly outside of the originating cluster. If a another cluster is right next to the original cluster (without overlapping), the new cluster can be overlapping with this second cluster. OverlapSave will tell you if the current cluster can degenerate so much that it overlaps with cluster 'other'
        Parameters:
        other - the potentially overlapping cluster
        Returns:
        true if cluster can potentially overlap
      • getDistanceVector

        public double[] getDistanceVector​(Instance instance)
      • getDistanceVector

        public double[] getDistanceVector​(SphereCluster other)
      • sample

        public Instance sample​(Random random)
        Samples this cluster by returning a point from inside it.
        Specified by:
        sample in class Cluster
        Parameters:
        random - a random number source
        Returns:
        a point that lies inside this cluster