2 // abstractdecisiontree.hpp
5 // Created by Abu Zaher Faridee on 7/22/12.
6 // Copyright (c) 2012 Schloss Lab. All rights reserved.
9 #ifndef rrf_fs_prototype_abstractdecisiontree_hpp
10 #define rrf_fs_prototype_abstractdecisiontree_hpp
12 #include "mothurout.h"
14 #include "rftreenode.hpp"
18 /**************************************************************************************************/
20 class AbstractDecisionTree{
24 AbstractDecisionTree(vector<vector<int> >baseDataSet,
25 vector<int> globalDiscardedFeatureIndices,
26 OptimumFeatureSubsetSelector optimumFeatureSubsetSelector,
27 string treeSplitCriterion);
28 virtual ~AbstractDecisionTree(){}
33 virtual int createBootStrappedSamples();
34 virtual int getMinEntropyOfFeature(vector<int> featureVector, vector<int> outputVector, double& minEntropy, int& featureSplitValue, double& intrinsicValue);
35 virtual int getBestSplitAndMinEntropy(vector< vector<int> > featureOutputPairs, vector<int> splitPoints, double& minEntropy, int& minEntropyIndex, double& relatedIntrinsicValue);
36 virtual double calcIntrinsicValue(int numLessThanValueAtSplitPoint, int numGreaterThanValueAtSplitPoint, int numSamples);
37 virtual double calcSplitEntropy(vector< vector<int> > featureOutputPairs, int splitIndex, int numOutputClasses, bool);
38 virtual int getSplitPopulation(RFTreeNode* node, vector< vector<int> >& leftChildSamples, vector< vector<int> >& rightChildSamples);
39 virtual bool checkIfAlreadyClassified(RFTreeNode* treeNode, int& outputClass);
41 vector< vector<int> > baseDataSet;
45 vector<int> outputClasses;
46 vector< vector<int> > bootstrappedTrainingSamples;
47 vector<int> bootstrappedTrainingSampleIndices;
48 vector< vector<int> > bootstrappedTestSamples;
49 vector<int> bootstrappedTestSampleIndices;
52 vector<int> globalDiscardedFeatureIndices;
53 int optimumFeatureSubsetSize;
54 string treeSplitCriterion;
61 /**************************************************************************************************/