From 156b536a1ffaeedf4f925c88b2202025d9fbb6a1 Mon Sep 17 00:00:00 2001 From: Ian Clarke Date: Sun, 19 Jul 2015 15:38:18 -0500 Subject: [PATCH] Fix bug related to missing attribute values --- pom.xml | 2 +- .../java/quickml/supervised/inspection/RandomForestDumper.java | 2 +- .../tree/decisionTree/reducers/DTCatBranchReducer.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c47c24c0..8b0c7853 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ be accompanied by a bump in version number, regardless of how minor the change. --> - 0.9.2 + 0.9.3 diff --git a/src/main/java/quickml/supervised/inspection/RandomForestDumper.java b/src/main/java/quickml/supervised/inspection/RandomForestDumper.java index c95464e1..20ce832d 100644 --- a/src/main/java/quickml/supervised/inspection/RandomForestDumper.java +++ b/src/main/java/quickml/supervised/inspection/RandomForestDumper.java @@ -68,7 +68,7 @@ public void summarizeModel(PrintStream out, RandomDecisionForest forest) { } - private static class TreeSummary { + public static class TreeSummary { private int splits; private Map attributes = new HashMap<>(); diff --git a/src/main/java/quickml/supervised/tree/decisionTree/reducers/DTCatBranchReducer.java b/src/main/java/quickml/supervised/tree/decisionTree/reducers/DTCatBranchReducer.java index c14e280a..b0301ddb 100644 --- a/src/main/java/quickml/supervised/tree/decisionTree/reducers/DTCatBranchReducer.java +++ b/src/main/java/quickml/supervised/tree/decisionTree/reducers/DTCatBranchReducer.java @@ -51,7 +51,7 @@ else if (acceptableMissingValue) continue; if (cc == null) { - cc = new ClassificationCounter(attrVal); + cc = new ClassificationCounter(attrVal != null ? attrVal : MISSING_VALUE); Serializable newKey = (attrVal != null) ? attrVal : MISSING_VALUE; result.put(newKey, cc); }