]> git.donarmstrong.com Git - mothur.git/blobdiff - forest.h
fixes while testing 1.33.0
[mothur.git] / forest.h
index c9d29dc2321325f216f04c325bffb38548b2b529..9e9860de61f2ec10e9bf02192856a3224ca46193 100644 (file)
--- a/forest.h
+++ b/forest.h
@@ -12,6 +12,7 @@
 #include <iostream>
 #include "mothurout.h"
 #include "macros.h"
+#include "decisiontree.hpp"
 #include "abstractdecisiontree.hpp"
 /***********************************************************************/
 //this is a re-implementation of the abstractrandomforest class
@@ -20,12 +21,19 @@ class Forest{
 public:
     // intialization with vectors
     Forest(const std::vector < std::vector<int> > dataSet,
-                         const int numDecisionTrees,
-                         const string);
+           const int numDecisionTrees,
+           const string treeSplitCriterion,
+           const bool doPruning,
+           const float pruneAggressiveness,
+           const bool discardHighErrorTrees,
+           const float highErrorTreeDiscardThreshold,
+           const string optimumFeatureSubsetSelectionCriteria,
+           const float featureStandardDeviationThreshold);
     virtual ~Forest(){ }
     virtual int populateDecisionTrees() = 0;
     virtual int calcForrestErrorRate() = 0;
     virtual int calcForrestVariableImportance(string) = 0;
+    virtual int updateGlobalOutOfBagEstimates(DecisionTree* decisionTree) = 0;
     
     /***********************************************************************/
     
@@ -51,6 +59,14 @@ protected:
     vector<int> globalDiscardedFeatureIndices;
     vector<double> globalVariableImportanceList;
     string treeSplitCriterion;
+  
+    bool doPruning;
+    float pruneAggressiveness;
+    bool discardHighErrorTrees;
+    float highErrorTreeDiscardThreshold;
+    string optimumFeatureSubsetSelectionCriteria;
+    float featureStandardDeviationThreshold;
+  
     // This is a map of each feature to outcome count of each classes
     // e.g. 1 => [2 7] means feature 1 has 2 outcome of 0 and 7 outcome of 1
     map<int, vector<int> > globalOutOfBagEstimates;