Class CobWeb

    • Field Detail

      • randomSeedOption

        public IntOption randomSeedOption
      • m_normal

        protected static final double m_normal
        Normal constant.
      • m_acuity

        protected double m_acuity
        Acuity (minimum standard deviation).
      • m_cutoff

        protected double m_cutoff
        Cutoff (minimum category utility).
      • m_cobwebTree

        protected moa.clusterers.CobWeb.CNode m_cobwebTree
        Holds the root of the Cobweb tree.
      • m_numberOfClusters

        protected int m_numberOfClusters
        Number of clusters (nodes in the tree). Must never be queried directly, only via the method numberOfClusters(). Otherwise it's not guaranteed that it contains the correct value.
        See Also:
        numberOfClusters(), m_numberOfClustersDetermined
      • m_numberOfClustersDetermined

        protected boolean m_numberOfClustersDetermined
        whether the number of clusters was already determined
      • m_numberSplits

        protected int m_numberSplits
        the number of splits that happened
      • m_numberMerges

        protected int m_numberMerges
        the number of merges that happened
      • m_saveInstances

        protected boolean m_saveInstances
        Output instances in graph representation of Cobweb tree (Allows instances at nodes in the tree to be visualized in the Explorer).
    • Constructor Detail

      • CobWeb

        public CobWeb()
    • Method Detail

      • trainOnInstanceImpl

        public void trainOnInstanceImpl​(Instance newInstance)
        Adds an instance to the clusterer.
        Specified by:
        trainOnInstanceImpl in class AbstractClusterer
        Parameters:
        newInstance - the instance to be added
        Throws:
        Exception - if something goes wrong
      • getVotesForInstance

        public double[] getVotesForInstance​(Instance instance)
        Classifies a given instance.
        Parameters:
        instance - the instance to be assigned to a cluster
        Returns:
        the number of the assigned cluster as an interger if the class is enumerated, otherwise the predicted value
        Throws:
        Exception - if instance could not be classified successfully
      • numberOfClusters

        public int numberOfClusters()
        Returns the number of clusters.
        Returns:
        the number of clusters
      • isRandomizable

        public boolean isRandomizable()
      • graph

        public String graph()
        Generates the graph string of the Cobweb tree
        Returns:
        a String value
        Throws:
        Exception - if an error occurs
      • setAcuity

        public void setAcuity​(double a)
        set the acuity.
        Parameters:
        a - the acuity value
      • getAcuity

        public double getAcuity()
        get the acuity value
        Returns:
        the acuity
      • setCutoff

        public void setCutoff​(double c)
        set the cutoff
        Parameters:
        c - the cutof
      • getCutoff

        public double getCutoff()
        get the cutoff
        Returns:
        the cutoff
      • getSaveInstanceData

        public boolean getSaveInstanceData()
        Get the value of saveInstances.
        Returns:
        Value of saveInstances.
      • setSaveInstanceData

        public void setSaveInstanceData​(boolean newsaveInstances)
        Set the value of saveInstances.
        Parameters:
        newsaveInstances - Value to assign to saveInstances.
      • getClusteringResult

        public Clustering getClusteringResult()