]> git.donarmstrong.com Git - mothur.git/commitdiff
added files for regularized random forest
authorKathryn Iverson <kd.iverson@gmail.com>
Fri, 16 Nov 2012 20:53:32 +0000 (15:53 -0500)
committerKathryn Iverson <kd.iverson@gmail.com>
Fri, 16 Nov 2012 20:53:32 +0000 (15:53 -0500)
Mothur.xcodeproj/project.pbxproj
regularizeddecisiontree.cpp [new file with mode: 0644]
regularizeddecisiontree.h [new file with mode: 0644]
regularizedrandomforest.cpp [new file with mode: 0644]
regularizedrandomforest.h [new file with mode: 0644]

index d360d2f49414c2b60fc79c32de09c7e7345ac265..c5ea99c15518788ae1d70defa1a74ae2d0f13433 100644 (file)
@@ -10,6 +10,8 @@
                219C1DE01552C4BD004209F9 /* newcommandtemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219C1DDF1552C4BD004209F9 /* newcommandtemplate.cpp */; };
                219C1DE41559BCCF004209F9 /* getcoremicrobiomecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219C1DE31559BCCD004209F9 /* getcoremicrobiomecommand.cpp */; };
                7E6BE10A12F710D8007ADDBE /* refchimeratest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E6BE10912F710D8007ADDBE /* refchimeratest.cpp */; };
+               834D9D581656D7C400E7FAB9 /* regularizedrandomforest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 834D9D561656D7C400E7FAB9 /* regularizedrandomforest.cpp */; };
+               834D9D5C1656DEC800E7FAB9 /* regularizeddecisiontree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 834D9D5A1656DEC700E7FAB9 /* regularizeddecisiontree.cpp */; };
                83F25B0C163B031200ABE73D /* forest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83F25B0A163B031200ABE73D /* forest.cpp */; };
                8DD76FB00486AB0100D96B5E /* mothur.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6A0FF2C0290799A04C91782 /* mothur.1 */; };
                A70056E6156A93D000924A2D /* getotulabelscommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70056E5156A93D000924A2D /* getotulabelscommand.cpp */; };
                7E6BE10812F710D8007ADDBE /* refchimeratest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = refchimeratest.h; sourceTree = "<group>"; };
                7E6BE10912F710D8007ADDBE /* refchimeratest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = refchimeratest.cpp; sourceTree = "<group>"; };
                7E78911B135F3E8600E725D2 /* eachgapdistignorens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eachgapdistignorens.h; sourceTree = "<group>"; };
+               834D9D561656D7C400E7FAB9 /* regularizedrandomforest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = regularizedrandomforest.cpp; sourceTree = "<group>"; };
+               834D9D571656D7C400E7FAB9 /* regularizedrandomforest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regularizedrandomforest.h; sourceTree = "<group>"; };
+               834D9D5A1656DEC700E7FAB9 /* regularizeddecisiontree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = regularizeddecisiontree.cpp; sourceTree = "<group>"; };
+               834D9D5B1656DEC700E7FAB9 /* regularizeddecisiontree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regularizeddecisiontree.h; sourceTree = "<group>"; };
                83F25B0A163B031200ABE73D /* forest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = forest.cpp; sourceTree = "<group>"; };
                83F25B0B163B031200ABE73D /* forest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = forest.h; sourceTree = "<group>"; };
                8DD76FB20486AB0100D96B5E /* mothur */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mothur; sourceTree = BUILT_PRODUCTS_DIR; };
                                A77E193A161B289600DB1A2A /* rftreenode.cpp */,
                                83F25B0A163B031200ABE73D /* forest.cpp */,
                                83F25B0B163B031200ABE73D /* forest.h */,
+                               834D9D561656D7C400E7FAB9 /* regularizedrandomforest.cpp */,
+                               834D9D571656D7C400E7FAB9 /* regularizedrandomforest.h */,
+                               834D9D5A1656DEC700E7FAB9 /* regularizeddecisiontree.cpp */,
+                               834D9D5B1656DEC700E7FAB9 /* regularizeddecisiontree.h */,
                        );
                        name = randomforest;
                        sourceTree = "<group>";
                                A721AB72161C572A009860A1 /* kmertree.cpp in Sources */,
                                A721AB77161C573B009860A1 /* taxonomynode.cpp in Sources */,
                                83F25B0C163B031200ABE73D /* forest.cpp in Sources */,
+                               834D9D581656D7C400E7FAB9 /* regularizedrandomforest.cpp in Sources */,
+                               834D9D5C1656DEC800E7FAB9 /* regularizeddecisiontree.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/regularizeddecisiontree.cpp b/regularizeddecisiontree.cpp
new file mode 100644 (file)
index 0000000..e95848a
--- /dev/null
@@ -0,0 +1,9 @@
+//
+//  regularizeddecisiontree.cpp
+//  Mothur
+//
+//  Created by Kathryn Iverson on 11/16/12.
+//  Copyright (c) 2012 Schloss Lab. All rights reserved.
+//
+
+#include "regularizeddecisiontree.h"
diff --git a/regularizeddecisiontree.h b/regularizeddecisiontree.h
new file mode 100644 (file)
index 0000000..47bb4c4
--- /dev/null
@@ -0,0 +1,16 @@
+//
+//  regularizeddecisiontree.h
+//  Mothur
+//
+//  Created by Kathryn Iverson on 11/16/12.
+//  Copyright (c) 2012 Schloss Lab. All rights reserved.
+//
+
+#ifndef __Mothur__regularizeddecisiontree__
+#define __Mothur__regularizeddecisiontree__
+
+#include <iostream>
+#include "rftreenode.hpp"
+#include "abstractdecisiontree.hpp"
+
+#endif /* defined(__Mothur__regularizeddecisiontree__) */
diff --git a/regularizedrandomforest.cpp b/regularizedrandomforest.cpp
new file mode 100644 (file)
index 0000000..55a8dc4
--- /dev/null
@@ -0,0 +1,57 @@
+//
+//  regularizedrandomforest.cpp
+//  Mothur
+//
+//  Created by Kathryn Iverson on 11/16/12.
+//  Copyright (c) 2012 Schloss Lab. All rights reserved.
+//
+
+#include "regularizedrandomforest.h"
+
+RegularizedRandomForest::RegularizedRandomForest(const vector <vector<int> > dataSet,const int numDecisionTrees,
+                           const string treeSplitCriterion = "informationGain") : Forest(dataSet, numDecisionTrees, treeSplitCriterion) {
+    m = MothurOut::getInstance();
+}
+
+int RegularizedRandomForest::calcForrestErrorRate() {
+    //
+    try {
+        return 0;
+    }
+    catch(exception& e) {
+               m->errorOut(e, "RegularizedRandomForest", "calcForrestErrorRate");
+               exit(1);
+       }
+}
+
+int RegularizedRandomForest::calcForrestVariableImportance(string filename) {
+    //
+    try {
+        return 0;
+    }
+    catch(exception& e) {
+               m->errorOut(e, "RegularizedRandomForest", "calcForrestVariableImportance");
+               exit(1);
+       }
+}
+
+int RegularizedRandomForest::populateDecisionTrees() {
+    //
+    try {
+        return 0;
+    }
+    catch(exception& e) {
+               m->errorOut(e, "RegularizedRandomForest", "populateDecisionTrees");
+               exit(1);
+       }
+}
+
+int RegularizedRandomForest::updateGlobalOutOfBagEstimates(DecisionTree *decisionTree) {
+    try {
+        return 0;
+    }
+    catch(exception& e) {
+               m->errorOut(e, "RegularizedRandomForest", "updateGlobalOutOfBagEstimates");
+               exit(1);
+       }
+}
\ No newline at end of file
diff --git a/regularizedrandomforest.h b/regularizedrandomforest.h
new file mode 100644 (file)
index 0000000..94bd624
--- /dev/null
@@ -0,0 +1,30 @@
+//
+//  regularizedrandomforest.h
+//  Mothur
+//
+//  Created by Kathryn Iverson on 11/16/12.
+//  Copyright (c) 2012 Schloss Lab. All rights reserved.
+//
+
+#ifndef __Mothur__regularizedrandomforest__
+#define __Mothur__regularizedrandomforest__
+
+#include "forest.h"
+#include "decisiontree.hpp"
+
+class RegularizedRandomForest: public Forest {
+public:
+    //
+    RegularizedRandomForest(const vector <vector<int> > dataSet,const int numDecisionTrees, const string);
+    
+    int calcForrestErrorRate();
+    int calcForrestVariableImportance(string);
+    int populateDecisionTrees();
+    int updateGlobalOutOfBagEstimates(DecisionTree* decisionTree);
+    
+private:
+    //
+    MothurOut* m;
+};
+
+#endif /* defined(__Mothur__regularizedrandomforest__) */