5 // Created by Kathryn Iverson on 10/26/12. Modified abstractrandomforest
6 // Copyright (c) 2012 Schloss Lab. All rights reserved.
9 #ifndef __Mothur__forest__
10 #define __Mothur__forest__
13 #include "mothurout.h"
15 #include "decisiontree.hpp"
16 #include "abstractdecisiontree.hpp"
17 /***********************************************************************/
18 //this is a re-implementation of the abstractrandomforest class
22 // intialization with vectors
23 Forest(const std::vector < std::vector<int> > dataSet,
24 const int numDecisionTrees,
27 virtual int populateDecisionTrees() = 0;
28 virtual int calcForrestErrorRate() = 0;
29 virtual int calcForrestVariableImportance(string) = 0;
30 virtual int updateGlobalOutOfBagEstimates(DecisionTree* decisionTree) = 0;
32 /***********************************************************************/
36 // TODO: create a better way of discarding feature
37 // currently we just set FEATURE_DISCARD_SD_THRESHOLD to 0 to solved this
38 // it can be tuned for better selection
39 // also, there might be other factors like Mean or other stuffs
40 // same would apply for createLocalDiscardedFeatureList in the TreeNode class
42 // TODO: Another idea is getting an aggregated discarded feature indices after the run, from combining
43 // the local discarded feature indices
44 // this would penalize a feature, even if in global space the feature looks quite good
45 // the penalization would be averaged, so this woould unlikely to create a local optmina
47 vector<int> getGlobalDiscardedFeatureIndices();
52 vector< vector<int> > dataSet;
53 vector<int> globalDiscardedFeatureIndices;
54 vector<double> globalVariableImportanceList;
55 string treeSplitCriterion;
56 // This is a map of each feature to outcome count of each classes
57 // e.g. 1 => [2 7] means feature 1 has 2 outcome of 0 and 7 outcome of 1
58 map<int, vector<int> > globalOutOfBagEstimates;
60 // TODO: fix this, do we use pointers?
61 vector<AbstractDecisionTree*> decisionTrees;
69 #endif /* defined(__Mothur__forest__) */