36 #ifndef GRT_RANDOM_FORESTS_HEADER
37 #define GRT_RANDOM_FORESTS_HEADER
39 #include "../DecisionTree/DecisionTree.h"
57 RandomForests(
const DecisionTreeNode &decisionTreeNode =
DecisionTreeClusterNode(),
const UINT forestSize=10,
const UINT numRandomSplits=100,
const UINT minNumSamplesPerNode=5,
const UINT maxDepth=10,
const UINT trainingMode = DecisionTree::BEST_RANDOM_SPLIT,
const bool removeFeaturesAtEachSpilt =
true,
const bool useScaling=
false);
104 virtual bool predict_(VectorDouble &inputVector);
111 virtual bool clear();
118 virtual bool print()
const;
174 const vector< DecisionTreeNode* > getForest()
const;
262 UINT numRandomSplits;
263 UINT minNumSamplesPerNode;
266 bool removeFeaturesAtEachSpilt;
268 vector< DecisionTreeNode* > forest;
277 #endif //GRT_RANDOM_FORESTS_HEADER
virtual bool deepCopyFrom(const Classifier *classifier)
virtual ~RandomForests(void)
virtual bool saveModelToFile(string filename) const
virtual bool print() const
bool getRemoveFeaturesAtEachSpilt() const
bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode)
virtual bool loadModelFromFile(string filename)
bool setNumRandomSplits(const UINT numSplittingSteps)
bool setDecisionTreeNode(const DecisionTreeNode &node)
RandomForests & operator=(const RandomForests &rhs)
virtual bool loadModelFromFile(fstream &file)
virtual bool saveModelToFile(fstream &file) const
bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt)
virtual bool predict_(VectorDouble &inputVector)
UINT getMinNumSamplesPerNode() const
bool setForestSize(const UINT forestSize)
UINT getTrainingMode() const
virtual bool train_(ClassificationData &trainingData)
UINT getNumRandomSplits() const
RandomForests(const DecisionTreeNode &decisionTreeNode=DecisionTreeClusterNode(), const UINT forestSize=10, const UINT numRandomSplits=100, const UINT minNumSamplesPerNode=5, const UINT maxDepth=10, const UINT trainingMode=DecisionTree::BEST_RANDOM_SPLIT, const bool removeFeaturesAtEachSpilt=true, const bool useScaling=false)
UINT getForestSize() const
bool setMaxDepth(const UINT maxDepth)
DecisionTreeNode * deepCopyDecisionTreeNode() const
bool setTrainingMode(const UINT trainingMode)