Package weka.classifiers.bayes.net

Examples of weka.classifiers.bayes.net.ParentSet.addParent()


    if (oParentSet.contains(nCandidateParent)) {
        return -1e100;
    }

    // set up candidate parent
    oParentSet.addParent(nCandidateParent, m_BayesNet.m_Instances);

    // calculate the score
    double logScore = calcNodeScore(nNode);

    // delete temporarily added parent
View Full Code Here


    // calculate the score
    double logScore = calcNodeScore(nNode);

    // restore temporarily deleted parent
    oParentSet.addParent(nCandidateParent, iParent, m_BayesNet.m_Instances);

    return logScore;
  } // CalcScoreWithMissingParent

  /**
 
View Full Code Here

      // insert arrows
      for (int iNode = 0; iNode < m_nNodes; iNode++) {
        ParentSet parentSet = m_BayesNet.getParentSet(iNode);
        for (int iNode2 = 0; iNode2 < m_nNodes; iNode2++) {
          if (m_bits[iNode2 + iNode * m_nNodes]) {
            parentSet.addParent(iNode2, m_BayesNet.m_Instances);
          }
        }
      }
      // calc score
      try {
View Full Code Here

   * @param iTail
   * @param instances
   */
  void applyArcAddition(BayesNet bayesNet, int iHead, int iTail, Instances instances) {
    ParentSet bestParentSet = bayesNet.getParentSet(iHead);
    bestParentSet.addParent(iTail, instances);
  } // applyArcAddition

  /**
   *
   * @param bayesNet
View Full Code Here

    if (oParentSet.contains(nCandidateParent)) {
        return -1e100;
    }

    // set up candidate parent
    oParentSet.addParent(nCandidateParent, m_BayesNet.m_Instances);

    // calculate the score
    double logScore = calcNodeScore(nNode);

    // delete temporarily added parent
View Full Code Here

    // calculate the score
    double logScore = calcNodeScore(nNode);

    // restore temporarily deleted parent
    oParentSet.addParent(nCandidateParent, iParent, m_BayesNet.m_Instances);

    return logScore;
  } // CalcScoreWithMissingParent

  /**
 
View Full Code Here

    protected void doMarkovBlanketCorrection(BayesNet bayesNet, Instances instances) {
        // Add class node as parent if it is not in the Markov Boundary
        int iClass = instances.classIndex();
        ParentSet ancestors = new ParentSet();
        int nOldSize = 0;
        ancestors.addParent(iClass, instances);
        while (nOldSize != ancestors.getNrOfParents()) {
            nOldSize = ancestors.getNrOfParents();
            for (int iNode = 0; iNode < nOldSize; iNode++) {
                int iCurrent = ancestors.getParent(iNode);
                ParentSet p = bayesNet.getParentSet(iCurrent);
View Full Code Here

      while (oParentSet.getNrOfParents() > 0) {
        oParentSet.deleteLastParent(m_instances);
      }
      for (int iParent = 0; iParent < maxn(); iParent++) {
        if (arrows[iParent][iNode]) {
          oParentSet.addParent(iParent, m_instances);
        }
      }
    }
  } // search
 
View Full Code Here

      // insert arrows
      for (int iNode = 0; iNode < m_nNodes; iNode++) {
        ParentSet parentSet = m_BayesNet.getParentSet(iNode);
        for (int iNode2 = 0; iNode2 < m_nNodes; iNode2++) {
          if (m_bits[iNode2 + iNode * m_nNodes]) {
            parentSet.addParent(iNode2, m_BayesNet.m_Instances);
          }
        }
      }
      // calc score
      m_fScore = 0.0;
View Full Code Here

      oParentSetX.deleteLastParent(m_instances);
    }
   
    // insert parents in iAttributeZ
    for (int iAttributeZ = 0; iAttributeZ < nAttributesZ; iAttributeZ++) {
      oParentSetX.addParent( iAttributesZ[iAttributeZ], m_instances);
    }
   
    double fScoreZ = calcNodeScore(iAttributeX);
    double fScoreZY = calcScoreWithExtraParent(iAttributeX, iAttributeY);
    if (fScoreZY <= fScoreZ) {
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.