Package weka.classifiers.bayes.net

Examples of weka.classifiers.bayes.net.BIFReader.processFile()


   * @param sFileName
   */
  public void loadBIFFromFile(String sFileName){
    BIFReader bayesNet = new BIFReader();
    try {
      bayesNet.processFile(sFileName);
      m_BayesNet = new EditableBayesNet(bayesNet);
      updateStatus();
        } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


  public void readBIFFromFile(String sFileName) throws BIFFormatException, IOException {
    m_sFileName = sFileName;
    try {

      BIFReader bayesNet = new BIFReader();
      bayesNet.processFile(sFileName);
      m_BayesNet = new EditableBayesNet(bayesNet);
      updateStatus();
      a_datagenerator.setEnabled(m_BayesNet.getNrOfNodes() > 0);
      m_BayesNet.clearUndoStack();
    } catch (Exception ex) {
View Full Code Here

   * @throws Exception if attribute from BIF file could not be found
   */
  public void buildStructure (BayesNet bayesNet, Instances instances) throws Exception {
    // read network structure in BIF format
    BIFReader bifReader = new BIFReader();
    bifReader.processFile(m_sBIFFile);
    // copy parent sets
        for (int iAttribute = 0; iAttribute < instances.numAttributes(); iAttribute++) {
            int iBIFAttribute = bifReader.getNode(bayesNet.getNodeName(iAttribute));
            ParentSet bifParentSet = bifReader.getParentSet(iBIFAttribute);
          for (int iBIFParent = 0; iBIFParent < bifParentSet.getNrOfParents(); iBIFParent++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.