Beispiel #1
0
 /**
  * It substracts the instances covered by a simple rule from this dataset; i.e., it deactivates
  * the instances covered by that rule.
  *
  * @param mask Mask the mask with the active entries of the dataset
  * @param sr SimpleRule the rule
  */
 public void substract(Mask mask, SimpleRule sr) {
   mask.resetIndex();
   int A = sr.getAttribute();
   double V = sr.getValue();
   int operator = sr.getOperator();
   while (mask.next()) {
     // if (X[mask.getIndex()][sr.getAttribute()]==sr.getValue())
     if (!((Itemset) itemsets.elementAt(mask.getIndex())).isMissing(A)) {
       if (operator == Rule.EQUAL
           && ((Itemset) itemsets.elementAt(mask.getIndex())).getValue(A) == V) mask.reset();
       if (operator == Rule.GREATER
           && ((Itemset) itemsets.elementAt(mask.getIndex())).getValue(A) > V) mask.reset();
       if (operator == Rule.LOWER
           && ((Itemset) itemsets.elementAt(mask.getIndex())).getValue(A) <= V) mask.reset();
     }
   }
 }