X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=randomforest.hpp;h=67d4372715ac2a6e31ba92b4a1f954910d1197f2;hp=5dd1876fcb4a796839173c16df01177235b74078;hb=615301e57c25e241356a9c2380648d117709458d;hpb=c2f279a697c7267b5d91882087ab91f7e6653aa2 diff --git a/randomforest.hpp b/randomforest.hpp index 5dd1876..67d4372 100644 --- a/randomforest.hpp +++ b/randomforest.hpp @@ -30,19 +30,21 @@ public: //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); int populateDecisionTrees(); int updateGlobalOutOfBagEstimates(DecisionTree* decisionTree); + int printConfusionMatrix(map intToTreatmentMap); + int getMissclassifications(string, map intToTreatmentMap, vector names); private: MothurOut* m;