Skip to content

Commit

Permalink
Some logging added during contrast sets induction.
Browse files Browse the repository at this point in the history
  • Loading branch information
agudys committed Jul 10, 2024
1 parent 3553664 commit 9bfa1ac
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.commons.collections15.Predicate;

import java.util.*;
import java.util.logging.Level;

public class ContrastRuleSet extends ClassificationRuleSet {

Expand Down Expand Up @@ -128,6 +129,8 @@ public void add(String positiveClass, String negativeClass, ContrastRule rule) {
List<ContrastRule> dest = sets.get(key);
double maxCost = 0;

Logger.log("Redundancy " + rule + ":\n", Level.FINER);

Set<String> queryAttrs = rule.getPremise().getAttributes();
for (Rule r : dest) {
Set<String> refAttrs = r.getPremise().getAttributes();
Expand All @@ -140,6 +143,8 @@ public void add(String positiveClass, String negativeClass, ContrastRule rule) {
union = rule.weighted_p + r.weighted_p - intersection;
double exampleJaccard = intersection / union;

Logger.log("\tExisting " + r + ":" + attributeJaccard + " * " + exampleJaccard + "\n", Level.FINER);

double cost = attributeJaccard * exampleJaccard;
if (cost > maxCost) {
maxCost = cost;
Expand Down

0 comments on commit 9bfa1ac

Please sign in to comment.