@@ -684,7 +684,7 @@ class TotalPosNeg {
684684 quality = modifier .modifyQuality (quality , attr .getName (), p , toCover_p );
685685 // prefer (gender = female) over (gender = !male) for boolean attributes
686686 if (quality > best .quality ||
687- (quality == best .quality && (p > best .covered || best .opposite ))) {
687+ (quality == best .quality && (p > best .covered || ( p == best .covered && best . opposite ) ))) {
688688 ElementaryCondition candidate =
689689 new ElementaryCondition (attr .getName (), new SingletonSet ((double ) i , attr .getMapping ().getValues ()));
690690 if (checkCandidate (candidate , classId , p , n , toCover_p , P , uncoveredPositives .size (), rule .getRuleOrderNum ())) {
@@ -741,7 +741,8 @@ class TotalPosNeg {
741741 for (Future f : futures ) {
742742 ConditionEvaluation eval = (ConditionEvaluation )f .get ();
743743
744- Logger .log ("\t Attribute best: " + eval .condition + ", quality=" + eval .quality + "\n " , Level .FINEST );
744+ Logger .log ("\t Attribute best: " + eval .condition + ", quality=" + eval .quality
745+ + ", p=" + eval .covered + "\n " , Level .FINEST );
745746
746747 if (best == null || eval .quality > best .quality || (eval .quality == best .quality && eval .covered > best .covered )) {
747748 best = eval ;
@@ -755,7 +756,8 @@ class TotalPosNeg {
755756 if (best .condition != null ) {
756757 Attribute bestAttr = trainSet .getAttributes ().get (((ElementaryCondition )best .condition ).getAttribute ());
757758
758- Logger .log ("\t Final best: " + best .condition + ", quality=" + best .quality + "\n " , Level .FINEST );
759+ Logger .log ("\t Final best: " + best .condition + ", quality=" + best .quality
760+ + ", p=" + best .covered + "\n " , Level .FINEST );
759761
760762 if (bestAttr .isNominal ()) {
761763 allowedAttributes .remove (bestAttr );
0 commit comments