Skip to content

Commit 2c3ceb3

Browse files
committed
RUL-86: Solved bug with pruning being executed on rules with only one condition.
1 parent 87cd558 commit 2c3ceb3

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

adaa.analytics.rules/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ codeQuality {
2727
}
2828

2929
sourceCompatibility = 1.8
30-
version = '1.7.16'
30+
version = '1.7.17'
3131

3232

3333
jar {

adaa.analytics.rules/src/main/java/adaa/analytics/rules/logic/induction/AbstractFinder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ public void prune(
223223
final Set<Integer> uncovered) {
224224

225225
Logger.log("AbstractFinder.prune()\n", Level.FINE);
226+
227+
if (rule.getPremise().getSubconditions().size() == 1) {
228+
return;
229+
}
230+
226231
boolean weighting = (trainSet.getAttributes().getWeight() != null);
227232

228233
// check preconditions

adaa.analytics.rules/src/main/java/adaa/analytics/rules/logic/induction/ClassificationFinder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ public int grow(
218218
*/
219219
public void prune(final Rule rule, final ExampleSet trainSet, final Set<Integer> uncovered) {
220220
Logger.log("ClassificationFinder.prune()\n", Level.FINE);
221+
222+
if (rule.getPremise().getSubconditions().size() == 1) {
223+
return;
224+
}
221225

222226
// check preconditions
223227
if (rule.getWeighted_p() == Double.NaN || rule.getWeighted_p() == Double.NaN ||

adaa.analytics.rules/src/main/java/adaa/analytics/rules/logic/induction/RegressionFinder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ protected ElementaryCondition induceCondition(
338338
}
339339

340340
Double [] keys = values2ids.keySet().toArray(new Double[values2ids.size()]);
341-
341+
Logger.log("\tChecking attribute " + attr.getName() + ", unique values: " + keys.length + "\n", Level.FINEST);
342+
343+
342344
// check all possible midpoints
343345
for (int keyId = 0; keyId < keys.length - 1; ++keyId) {
344346
double key = keys[keyId];

0 commit comments

Comments
 (0)