コード例 #1
0
ファイル: ABB.java プロジェクト: Navieclipse/KEEL
  /**
   * Checks if a node is legitimate. A node is illegitimate if its hamming distance to a pruned node
   * is 1 (this is, the node is a child of a previously pruned node).
   *
   * @param f node to check its legitimacy
   * @return true if the node is legitimate, false otherwise.
   */
  private boolean legitimate(boolean f[]) {
    boolean feas = true;
    for (int i = 0; i < pruned.size() && feas; i++) {
      if (hamming(pruned.elementAt(i), f) == 1) feas = false;
    }

    return feas;
  }
コード例 #2
0
ファイル: ABB.java プロジェクト: Navieclipse/KEEL
  /** Recursive method for ABB */
  private void abb(boolean feat[]) {
    boolean[] child;
    double measure;

    threshold = data.measureIEP(feat);

    for (int i = 0; i < cardinalidadCto(feat); i++) {
      child = removeOne(feat, i);
      measure = data.measureIEP(child);

      if (legitimate(child) && measure < threshold) {
        if (measure < data.measureIEP(features)) {
          // we keep the best found in 'features'
          System.arraycopy(child, 0, features, 0, child.length);
        }
        abb(child);
      } else { // we prune this node
        pruned.add(child);
      }
    }
  }