21 #ifndef __DECISION_FOREST_CLASSIFICATION_MODEL_BUILDER_H__
22 #define __DECISION_FOREST_CLASSIFICATION_MODEL_BUILDER_H__
24 #include "algorithms/decision_forest/decision_forest_classification_model.h"
30 namespace decision_forest
40 namespace classification
60 class DAAL_EXPORT ModelBuilder
66 typedef size_t NodeId;
71 typedef size_t TreeId;
73 static const NodeId noParent =
static_cast<size_t>(-1);
80 ModelBuilder(
size_t nClasses,
size_t nTrees)
82 _status |= initialize(nClasses, nTrees);
83 services::throwIfPossible(_status);
91 TreeId createTree(
size_t nNodes)
94 _status |= createTreeInternal(nNodes, resId);
95 services::throwIfPossible(_status);
107 NodeId addLeafNode(TreeId treeId, NodeId parentId,
size_t position,
size_t classLabel)
110 _status |= addLeafNodeInternal(treeId, parentId, position, classLabel, resId);
111 services::throwIfPossible(_status);
124 NodeId addSplitNode(TreeId treeId, NodeId parentId,
size_t position,
size_t featureIndex,
double featureValue)
127 _status |= addSplitNodeInternal(treeId, parentId, position, featureIndex, featureValue, resId);
128 services::throwIfPossible(_status);
138 services::throwIfPossible(_status);
146 services::Status getStatus()
153 services::Status _status;
154 services::Status initialize(
size_t nClasses,
size_t nTrees);
155 services::Status createTreeInternal(
size_t nNodes, TreeId& resId);
156 services::Status addLeafNodeInternal(TreeId treeId, NodeId parentId,
size_t position,
size_t classLabel, NodeId& res);
157 services::Status addSplitNodeInternal(TreeId treeId, NodeId parentId,
size_t position,
size_t featureIndex,
double featureValue, NodeId& res);
161 using interface1::ModelBuilder;
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::getModel
ModelPtr getModel()
Definition: decision_forest_classification_model_builder.h:136
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::createTree
TreeId createTree(size_t nNodes)
Definition: decision_forest_classification_model_builder.h:91
daal
Definition: algorithm_base_common.h:31
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::NodeId
size_t NodeId
Node identifier type is size_t
Definition: decision_forest_classification_model_builder.h:66
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::ModelBuilder
ModelBuilder(size_t nClasses, size_t nTrees)
Definition: decision_forest_classification_model_builder.h:80
daal::algorithms::decision_forest::classification::interface1::ModelBuilder
Model Builder class for Decision Forest Classification Model algorithm
Definition: decision_forest_classification_model_builder.h:60
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::addSplitNode
NodeId addSplitNode(TreeId treeId, NodeId parentId, size_t position, size_t featureIndex, double featureValue)
Definition: decision_forest_classification_model_builder.h:124
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::addLeafNode
NodeId addLeafNode(TreeId treeId, NodeId parentId, size_t position, size_t classLabel)
Definition: decision_forest_classification_model_builder.h:107
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::TreeId
size_t TreeId
Tree identifier type is size_t
Definition: decision_forest_classification_model_builder.h:71
daal::algorithms::decision_forest::classification::interface1::ModelBuilder::getStatus
services::Status getStatus()
Definition: decision_forest_classification_model_builder.h:146