Пример #1
0
  /**
   * Compute the best information gain for the specified antecedent
   *
   * @param instances the data based on which the infoGain is computed
   * @param defAcRt the default accuracy rate of data
   * @param antd the specific antecedent
   * @param numConds the number of antecedents in the rule so far
   * @return the data covered by the antecedent
   */
  private Instances computeInfoGain(Instances instances, double defAcRt, Antd antd) {
    Instances data = instances;

    /* Split the data into bags.
    The information gain of each bag is also calculated in this procedure */
    Instances[] splitData = antd.splitData(data, defAcRt, m_Consequent);

    /* Get the bag of data to be used for next antecedents */
    if (splitData != null) return splitData[(int) antd.getAttrValue()];
    else return null;
  }