35 #ifndef GRT_RANDOM_FORESTS_HEADER
36 #define GRT_RANDOM_FORESTS_HEADER
38 #include "../DecisionTree/DecisionTree.h"
58 const UINT forestSize=10,
59 const UINT numRandomSplits=100,
60 const UINT minNumSamplesPerNode=5,
61 const UINT maxDepth=10,
62 const UINT trainingMode = DecisionTree::BEST_RANDOM_SPLIT,
63 const bool removeFeaturesAtEachSpilt =
true,
64 const bool useScaling=
false,
65 const Float bootstrappedDatasetWeight = 0.8);
119 virtual bool clear();
126 virtual bool print()
const;
338 UINT numRandomSplits;
339 UINT minNumSamplesPerNode;
342 bool removeFeaturesAtEachSpilt;
343 Float bootstrappedDatasetWeight;
354 #endif //GRT_RANDOM_FORESTS_HEADER
DecisionTreeNode * getTree(const UINT index) const
virtual bool loadModelFromFile(std::fstream &file)
UINT getForestSize() 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, const Float bootstrappedDatasetWeight=0.8)
virtual ~RandomForests(void)
virtual bool saveModelToFile(std::fstream &file) const
bool setBootstrappedDatasetWeight(const Float bootstrappedDatasetWeight)
bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode)
bool combineModels(const RandomForests &forest)
RandomForests & operator=(const RandomForests &rhs)
bool setNumRandomSplits(const UINT numSplittingSteps)
virtual bool train_(ClassificationData &trainingData)
MatrixDouble getLeafNodeFeatureWeights(const bool normWeights=true) const
bool setForestSize(const UINT forestSize)
virtual bool saveModelToFile(std::string filename) const
bool setMaxDepth(const UINT maxDepth)
UINT getNumRandomSplits() const
virtual bool deepCopyFrom(const Classifier *classifier)
Float getBootstrappedDatasetWeight() const
bool setTrainingMode(const UINT trainingMode)
virtual bool loadModelFromFile(std::string filename)
UINT getMinNumSamplesPerNode() const
bool setDecisionTreeNode(const DecisionTreeNode &node)
virtual bool predict_(VectorDouble &inputVector)
VectorDouble getFeatureWeights(const bool normWeights=true) const
const Vector< DecisionTreeNode * > & getForest() const
bool getRemoveFeaturesAtEachSpilt() const
virtual bool print() const
bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt)
UINT getTrainingMode() const
DecisionTreeNode * deepCopyDecisionTreeNode() const