Class BayesNetEstimator

    • Constructor Detail

      • BayesNetEstimator

        public BayesNetEstimator()
    • Method Detail

      • estimateCPTs

        public void estimateCPTs​(BayesNet bayesNet)
                          throws Exception
        estimateCPTs estimates the conditional probability tables for the Bayes Net using the network structure.
        Parameters:
        bayesNet - the bayes net to use
        Throws:
        Exception - always throws an exception, since subclass needs to be used
      • updateClassifier

        public void updateClassifier​(BayesNet bayesNet,
                                     Instance instance)
                              throws Exception
        Updates the classifier with the given instance.
        Parameters:
        bayesNet - the bayes net to use
        instance - the new training instance to include in the model
        Throws:
        Exception - always throws an exception, since subclass needs to be used
      • distributionForInstance

        public double[] distributionForInstance​(BayesNet bayesNet,
                                                Instance instance)
                                         throws Exception
        Calculates the class membership probabilities for the given test instance.
        Parameters:
        bayesNet - the bayes net to use
        instance - the instance to be classified
        Returns:
        predicted class probability distribution
        Throws:
        Exception - always throws an exception, since subclass needs to be used
      • initCPTs

        public void initCPTs​(BayesNet bayesNet)
                      throws Exception
        initCPTs reserves space for CPTs and set all counts to zero
        Parameters:
        bayesNet - the bayes net to use
        Throws:
        Exception - always throws an exception, since subclass needs to be used
      • listOptions

        public Enumeration<Option> listOptions()
        Returns an enumeration describing the available options
        Specified by:
        listOptions in interface OptionHandler
        Returns:
        an enumeration of all the available options
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.

        Valid options are:

         -A <alpha>
          Initial count (alpha)
         
        Specified by:
        setOptions in interface OptionHandler
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • getOptions

        public String[] getOptions()
        Gets the current settings of the classifier.
        Specified by:
        getOptions in interface OptionHandler
        Returns:
        an array of strings suitable for passing to setOptions
      • setAlpha

        public void setAlpha​(double fAlpha)
        Set prior used in probability table estimation
        Parameters:
        fAlpha - representing prior
      • getAlpha

        public double getAlpha()
        Get prior used in probability table estimation
        Returns:
        prior
      • alphaTipText

        public String alphaTipText()
        Returns:
        a string to describe the Alpha option.
      • globalInfo

        public String globalInfo()
        This will return a string describing the class.
        Returns:
        The string.