Repository: incubator-samoa
Updated Branches:
  refs/heads/master 81138478c -> 82b3ef370


SAMOA-52: Fix nominal attributes problem in VHT


Project: http://git-wip-us.apache.org/repos/asf/incubator-samoa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-samoa/commit/82b3ef37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-samoa/tree/82b3ef37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-samoa/diff/82b3ef37

Branch: refs/heads/master
Commit: 82b3ef370fcbaad9a6535728bb99d9d39185a599
Parents: 8113847
Author: Albert Bifet <[email protected]>
Authored: Mon Dec 7 14:20:00 2015 +0100
Committer: Gianmarco De Francisci Morales <[email protected]>
Committed: Wed Mar 16 09:26:24 2016 +0300

----------------------------------------------------------------------
 .../classifiers/trees/ActiveLearningNode.java   |  2 ++
 .../trees/ModelAggregatorProcessor.java         | 34 +++++++++++---------
 2 files changed, 20 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/82b3ef37/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ActiveLearningNode.java
----------------------------------------------------------------------
diff --git 
a/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ActiveLearningNode.java
 
b/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ActiveLearningNode.java
index 860b951..a437719 100644
--- 
a/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ActiveLearningNode.java
+++ 
b/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ActiveLearningNode.java
@@ -178,6 +178,8 @@ final class ActiveLearningNode extends LearningNode {
     this.isSplitting = false;
     logger.trace("wasted instance: {}", this.thrownAwayInstance);
     this.thrownAwayInstance = 0;
+    this.bestSuggestion = null;
+    this.secondBestSuggestion = null;
   }
 
   AttributeSplitSuggestion getDistributedBestSuggestion() {

http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/82b3ef37/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
----------------------------------------------------------------------
diff --git 
a/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
 
b/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
index cad40a7..aff25bf 100644
--- 
a/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
+++ 
b/samoa-api/src/main/java/org/apache/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
@@ -439,22 +439,24 @@ final class ModelAggregatorProcessor implements Processor 
{
    *          The data structure to represents the filtering of the instance 
using the tree model.
    */
   private void attemptToSplit(ActiveLearningNode activeLearningNode, FoundNode 
foundNode) {
-    // Increment the split ID
-    this.splitId++;
-
-    // Schedule time-out thread
-    ScheduledFuture<?> timeOutHandler = this.executor.schedule(new 
AggregationTimeOutHandler(this.splitId,
-        this.timedOutSplittingNodes), this.timeOut, TimeUnit.SECONDS);
-
-    // Keep track of the splitting node information, so that we can continue 
the
-    // split
-    // once we receive all local statistic calculation from Local Statistic PI
-    // this.splittingNodes.put(Long.valueOf(this.splitId), new
-    // SplittingNodeInfo(activeLearningNode, foundNode, null));
-    this.splittingNodes.put(this.splitId, new 
SplittingNodeInfo(activeLearningNode, foundNode, timeOutHandler));
-
-    // Inform Local Statistic PI to perform local statistic calculation
-    activeLearningNode.requestDistributedSuggestions(this.splitId, this);
+    if (!activeLearningNode.observedClassDistributionIsPure()) {
+      // Increment the split ID
+      this.splitId++;
+
+      // Schedule time-out thread
+      ScheduledFuture<?> timeOutHandler = this.executor.schedule(new 
AggregationTimeOutHandler(this.splitId,
+              this.timedOutSplittingNodes), this.timeOut, TimeUnit.SECONDS);
+
+      // Keep track of the splitting node information, so that we can continue 
the
+      // split
+      // once we receive all local statistic calculation from Local Statistic 
PI
+      // this.splittingNodes.put(Long.valueOf(this.splitId), new
+      // SplittingNodeInfo(activeLearningNode, foundNode, null));
+      this.splittingNodes.put(this.splitId, new 
SplittingNodeInfo(activeLearningNode, foundNode, timeOutHandler));
+
+      // Inform Local Statistic PI to perform local statistic calculation
+      activeLearningNode.requestDistributedSuggestions(this.splitId, this);
+    }
   }
 
   /**

Reply via email to