public static double numAllConditions(Instances data){
  double total=0;
  Enumeration<Attribute> attEnum=data.enumerateAttributes();
  while (attEnum.hasMoreElements()) {
    Attribute att=attEnum.nextElement();
    if (att.isNominal()) {
      total+=att.numValues();
    }
 else {
      total+=2.0 * data.numDistinctValues(att);
    }
  }
  return total;
}

public static double numAllConditions ( Instances data ) { double total = 0 ; Enumeration < Attribute > attEnum = data . enumerateAttributes ( ) ; while ( attEnum . hasMoreElements ( ) ) { Attribute att = attEnum . nextElement ( ) ; if ( att . isNominal ( ) ) { total += att . numValues ( ) ; } else { total += 2.0 * data . numDistinctValues ( att ) ; } } return total ; }
compute the number of all possible conditions that could appear in a rule of a given data . for nominal attributes , it ' s the number of values that could appear ; for numeric attributes , it ' s the number of values * 2 , i . e . < = and > = are counted as different possible conditions .
