X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=randomforest.hpp;h=d0ac1ec063d46d4ff1367e87cf322870f7e49a9c;hb=372fb21ea66ced432b109225851a1b80ef0491a3;hp=30eb43842f8cb280e1e4e95919909885f2702d28;hpb=d263f4b3a4f96c672317d317061f6adb72656427;p=mothur.git diff --git a/randomforest.hpp b/randomforest.hpp old mode 100755 new mode 100644 index 30eb438..d0ac1ec --- a/randomforest.hpp +++ b/randomforest.hpp @@ -6,8 +6,8 @@ // Copyright (c) 2012 Schloss Lab. All rights reserved. // -#ifndef rrf_fs_prototype_randomforest_hpp -#define rrf_fs_prototype_randomforest_hpp +#ifndef RF_RANDOMFOREST_HPP +#define RF_RANDOMFOREST_HPP #include "macros.h" #include "forest.h" @@ -17,20 +17,27 @@ class RandomForest: public Forest { public: - // DONE - RandomForest(const vector > dataSet,const int numDecisionTrees, const string); + RandomForest(const vector > dataSet, + const int numDecisionTrees, + const string treeSplitCriterion, + const bool doPruning, + const float pruneAggressiveness, + const bool discardHighErrorTrees, + const float highErrorTreeDiscardThreshold, + const string optimumFeatureSubsetSelectionCriteria, + const float featureStandardDeviationThreshold); //NOTE:: if you are going to dynamically cast, aren't you undoing the advantage of abstraction. Why abstract at all? //could cause maintenance issues later if other types of Abstract decison trees are created that cannot be cast as a decision tree. -// virtual ~RandomForest() { -// for (vector::iterator it = decisionTrees.begin(); it != decisionTrees.end(); it++) { -// // we know that this is decision tree, so we can do a dynamic_case here -// DecisionTree* decisionTree = dynamic_cast(*it); -// // calling the destructor by deleting -// delete decisionTree; -// } -// } + virtual ~RandomForest() { + for (vector::iterator it = decisionTrees.begin(); it != decisionTrees.end(); it++) { + // we know that this is decision tree, so we can do a dynamic_case here + DecisionTree* decisionTree = dynamic_cast(*it); + // calling the destructor by deleting + delete decisionTree; + } + } int calcForrestErrorRate(); int calcForrestVariableImportance(string);