Skip to content

Commit

Permalink
Fixed bug in regression/survival expert rules (issue 127). Added miss…
Browse files Browse the repository at this point in the history
…ing test reports from the previous commit.
  • Loading branch information
agudys committed Nov 22, 2024
1 parent 24243cd commit 9f2dfd1
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 11 deletions.
2 changes: 1 addition & 1 deletion adaa.analytics.rules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'java'
}

version = '2.1.23'
version = '2.1.24'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ public void adjust(
CompoundCondition expertPremise = rule.getPremise();
rule.setPremise(new CompoundCondition());

IntegerBitSet positives = new IntegerBitSet(dataset.size());
IntegerBitSet negatives = new IntegerBitSet(dataset.size());
Covering covering = new Covering();
// ugly
covering.positives = positives;
covering.negatives = negatives;

for (ConditionBase cnd : expertPremise.getSubconditions()) {
ElementaryCondition ec = (ElementaryCondition)cnd;
Expand All @@ -68,10 +73,12 @@ public void adjust(

// update covering information - needed for automatic induction
covering.clear();

rule.covers(dataset, covering, covering.positives, covering.negatives);
Set<Integer> covered = new HashSet<Integer>();
covered.addAll(covering.positives);
covered.addAll(covering.negatives);
Set<Integer> covered = new IntegerBitSet(dataset.size());
covered.addAll(positives);
covered.addAll(negatives);

rule.setCoveringInformation(covering);

// determine attribute
Expand Down Expand Up @@ -111,13 +118,7 @@ public void adjust(
}

covering.clear();
IntegerBitSet positives = new IntegerBitSet(dataset.size());
IntegerBitSet negatives = new IntegerBitSet(dataset.size());
rule.covers(dataset, covering, positives, negatives);

// ugly
covering.positives = positives;
covering.negatives = negatives;
rule.covers(dataset, covering, covering.positives, covering.negatives);
rule.setCoveringInformation(covering);

rule.setCoveredNegatives(negatives);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@
<param name ="expert_forbidden_conditions">
</param>
</parameter_set>

<parameter_set name="guided-s5, adjust">
<param name="min_rule_covered">5</param>
<param name="use_expert">true</param>
<param name="extend_using_preferred">false</param>
<param name="extend_using_automatic">false</param>
<param name="induce_using_preferred">false</param>
<param name="induce_using_automatic">false</param>
<param name ="expert_rules">
<entry name="rule-0">IF CD34kgx10d6 @= Any THEN </entry>
<entry name="rule-1">IF Donorage @= Any THEN </entry>
<entry name="rule-2">IF Donorage @= (50, inf) THEN </entry>
</param>
<param name ="expert_preferred_conditions">
</param>
<param name ="expert_forbidden_conditions">
</param>
</parameter_set>

</parameter_sets>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


Rules
IF [[gimpuls = (-inf, 177.50)]] THEN class = {0}
IF [[gimpuls = (-inf, 239.50)]] THEN class = {0}
IF [[gimpuls = <408.50, inf)]] THEN class = {1}
IF [[gimpuls = <317.50, inf)]] THEN class = {1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


Rules
IF [[seismoacoustic = {a}]] THEN class = {0}
IF [[seismoacoustic = {a}]] THEN class = {1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


Rules
IF [[seismoacoustic = !{b}]] THEN class = {0}
IF [[seismoacoustic = !{c}]] THEN class = {1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


Rules
IF [[CD34kgx10d6 = (-inf, 11.86)]] THEN
IF [[Donorage = (-inf, 45.53)]] THEN
IF [[Donorage = <45.53, inf)]] THEN

0 comments on commit 9f2dfd1

Please sign in to comment.