25 Tree::Tree(
const UINT numSplittingSteps,
const UINT minNumSamplesPerNode,
const UINT maxDepth,
const bool removeFeaturesAtEachSpilt,
const UINT trainingMode)
28 this->numSplittingSteps = numSplittingSteps;
29 this->minNumSamplesPerNode = minNumSamplesPerNode;
30 this->maxDepth = maxDepth;
31 this->removeFeaturesAtEachSpilt = removeFeaturesAtEachSpilt;
32 this->trainingMode = trainingMode;
34 debugLog.setProceedingText(
"[DEBUG Tree]");
35 errorLog.setProceedingText(
"[ERROR Tree]");
36 trainingLog.setProceedingText(
"[TRAINING Tree]");
37 warningLog.setProceedingText(
"[WARNING Tree]");
57 std::ostringstream stream;
60 std::cout << stream.str();
96 return numSplittingSteps;
100 return minNumSamplesPerNode;
117 return removeFeaturesAtEachSpilt;
121 if( trainingMode >= BEST_ITERATIVE_SPILT && trainingMode < NUM_TRAINING_MODES ){
122 this->trainingMode = trainingMode;
125 warningLog <<
"Unknown trainingMode: " << trainingMode << std::endl;
130 if( numSplittingSteps > 0 ){
131 this->numSplittingSteps = numSplittingSteps;
134 warningLog <<
"setNumSplittingSteps(const UINT numSplittingSteps) - The number of splitting steps must be greater than zero!" << std::endl;
139 if( minNumSamplesPerNode > 0 ){
140 this->minNumSamplesPerNode = minNumSamplesPerNode;
143 warningLog <<
"setMinNumSamplesPerNode(const UINT minNumSamplesPerNode) - The minimum number of samples per node must be greater than zero!" << std::endl;
149 this->maxDepth = maxDepth;
152 warningLog <<
"setMaxDepth(const UINT maxDepth) - The maximum depth must be greater than zero!" << std::endl;
157 this->removeFeaturesAtEachSpilt = removeFeaturesAtEachSpilt;
bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt)
virtual bool getModel(std::ostream &stream) const
bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode)
virtual bool print() const
UINT getNumSplittingSteps() const
virtual bool getModel(std::ostream &stream) const
bool setNumSplittingSteps(const UINT numSplittingSteps)
bool getRemoveFeaturesAtEachSpilt() const
UINT getTrainingMode() const
virtual Node * deepCopyNode() const
const Node * getTree() const
bool setMaxDepth(const UINT maxDepth)
UINT getPredictedNodeID() const
Tree(const UINT numSplittingSteps=100, const UINT minNumSamplesPerNode=5, const UINT maxDepth=10, const bool removeFeaturesAtEachSpilt=false, const UINT trainingMode=BEST_ITERATIVE_SPILT)
This class implements the base class Tree used for the DecisionTree, RegressionTree and ClusterTree...
virtual Node * deepCopyTree() const
UINT getMinNumSamplesPerNode() const
bool setTrainingMode(const UINT trainingMode)
UINT getPredictedNodeID() const