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 "abstractdecisiontree.hpp"
16 /***********************************************************************/
17 //this is a re-implementation of the abstractrandomforest class
21 // intialization with vectors
22 Forest(const std::vector < std::vector<int> > dataSet,
23 const int numDecisionTrees,
26 virtual int populateDecisionTrees() = 0;
27 virtual int calcForrestErrorRate() = 0;
28 virtual int calcForrestVariableImportance(string) = 0;
30 /***********************************************************************/
34 // TODO: create a better way of discarding feature
35 // currently we just set FEATURE_DISCARD_SD_THRESHOLD to 0 to solved this
36 // it can be tuned for better selection
37 // also, there might be other factors like Mean or other stuffs
38 // same would apply for createLocalDiscardedFeatureList in the TreeNode class
40 // TODO: Another idea is getting an aggregated discarded feature indices after the run, from combining
41 // the local discarded feature indices
42 // this would penalize a feature, even if in global space the feature looks quite good
43 // the penalization would be averaged, so this woould unlikely to create a local optmina
45 vector<int> getGlobalDiscardedFeatureIndices();
50 vector< vector<int> > dataSet;
51 vector<int> globalDiscardedFeatureIndices;
52 vector<double> globalVariableImportanceList;
53 string treeSplitCriterion;
54 // This is a map of each feature to outcome count of each classes
55 // e.g. 1 => [2 7] means feature 1 has 2 outcome of 0 and 7 outcome of 1
56 map<int, vector<int> > globalOutOfBagEstimates;
58 // TODO: fix this, do we use pointers?
59 vector<AbstractDecisionTree*> decisionTrees;
67 #endif /* defined(__Mothur__forest__) */