Class FromFile

  • All Implemented Interfaces:
    Serializable, OptionHandler, RevisionHandler

    public class FromFile
    extends SearchAlgorithm
    The FromFile reads the structure of a Bayes net from a file in BIFF format.

    Valid options are:

     -B <BIF File>
      Name of file containing network structure in BIF format
     
    Version:
    $Revision$
    Author:
    Remco Bouckaert
    See Also:
    Serialized Form
    • Constructor Detail

      • FromFile

        public FromFile()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this object
        Returns:
        a description of the classifier suitable for displaying in the explorer/experimenter gui
      • buildStructure

        public void buildStructure​(BayesNet bayesNet,
                                   Instances instances)
                            throws Exception
        Description copied from class: SearchAlgorithm
        buildStructure determines the network structure/graph of the network. The default behavior is creating a network where all nodes have the first node as its parent (i.e., a BayesNet that behaves like a naive Bayes classifier). This method can be overridden by derived classes to restrict the class of network structures that are acceptable.
        Overrides:
        buildStructure in class SearchAlgorithm
        Parameters:
        bayesNet -
        instances - the instances to work with
        Throws:
        Exception - if attribute from BIF file could not be found
      • setBIFFile

        public void setBIFFile​(String sBIFFile)
        Set name of network in BIF file to read structure from
        Parameters:
        sBIFFile - the name of the BIF file
      • getBIFFile

        public String getBIFFile()
        Get name of network in BIF file to read structure from
        Returns:
        BIF file name
      • setOptions

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

        Valid options are:

         -B <BIF File>
          Name of file containing network structure in BIF format
         
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class SearchAlgorithm
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported