diff --git a/cpp/daal/include/algorithms/decision_forest/decision_forest_classification_model_builder.h b/cpp/daal/include/algorithms/decision_forest/decision_forest_classification_model_builder.h index 46b5aaa804b..57c02325ac7 100644 --- a/cpp/daal/include/algorithms/decision_forest/decision_forest_classification_model_builder.h +++ b/cpp/daal/include/algorithms/decision_forest/decision_forest_classification_model_builder.h @@ -118,14 +118,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addLeafNode(const TreeId treeId, const NodeId parentId, const size_t position, const size_t classLabel) - { - return addLeafNode(treeId, parentId, position, classLabel, 0); - } - /** * Create Leaf node and add it to certain tree * \param[in] treeId Tree to which new node is added @@ -143,14 +135,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addLeafNodeByProba(const TreeId treeId, const NodeId parentId, const size_t position, const double * const proba) - { - return addLeafNodeByProba(treeId, parentId, position, proba, 0); - } - /** * Create Split node and add it to certain tree * \param[in] treeId Tree to which new node is added @@ -171,15 +155,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addSplitNode(const TreeId treeId, const NodeId parentId, const size_t position, const size_t featureIndex, - const double featureValue) - { - return addSplitNode(treeId, parentId, position, featureIndex, featureValue, 0, 0); - } - void setNFeatures(size_t nFeatures) { if (!_model.get()) diff --git a/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_classification_model_builder.h b/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_classification_model_builder.h index b8d1c5da47d..71dfdbfb3a5 100644 --- a/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_classification_model_builder.h +++ b/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_classification_model_builder.h @@ -120,14 +120,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addLeafNode(TreeId treeId, NodeId parentId, size_t position, double response) - { - return addLeafNode(treeId, parentId, position, response, 0); - } - /** * Create Split node and add it to certain tree * \param[in] treeId Tree to which new node is added @@ -147,14 +139,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addSplitNode(TreeId treeId, NodeId parentId, size_t position, size_t featureIndex, double featureValue) - { - return addSplitNode(treeId, parentId, position, featureIndex, featureValue, 0, 0); - } - /** * Get built model * \return Model pointer diff --git a/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_regression_model_builder.h b/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_regression_model_builder.h index c9343f03d8d..56ac526437e 100644 --- a/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_regression_model_builder.h +++ b/cpp/daal/include/algorithms/gradient_boosted_trees/gbt_regression_model_builder.h @@ -118,14 +118,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addLeafNode(TreeId treeId, NodeId parentId, size_t position, double response) - { - return addLeafNode(treeId, parentId, position, response, 0); - } - /** * Create Split node and add it to certain tree * \param[in] treeId Tree to which new node is added @@ -145,14 +137,6 @@ class DAAL_EXPORT ModelBuilder return resId; } - /** - * \DAAL_DEPRECATED - */ - DAAL_DEPRECATED NodeId addSplitNode(TreeId treeId, NodeId parentId, size_t position, size_t featureIndex, double featureValue) - { - return addSplitNode(treeId, parentId, position, featureIndex, featureValue, 0, 0); - } - /** * Get built model * \return Model pointer diff --git a/examples/daal/cpp/source/decision_forest/df_cls_dense_batch_model_builder.cpp b/examples/daal/cpp/source/decision_forest/df_cls_dense_batch_model_builder.cpp index dab3de1ceb4..b18182e5e3b 100644 --- a/examples/daal/cpp/source/decision_forest/df_cls_dense_batch_model_builder.cpp +++ b/examples/daal/cpp/source/decision_forest/df_cls_dense_batch_model_builder.cpp @@ -60,27 +60,40 @@ int main(int argc, char* argv[]) { decision_forest::classification::ModelPtr buildModel() { const size_t nNodes = 3; + const int defaultLeft = 0; + const double cover = 0.0; ModelBuilder modelBuilder(nClasses, nTrees); ModelBuilder::TreeId tree1 = modelBuilder.createTree(nNodes); ModelBuilder::NodeId root1 = - modelBuilder.addSplitNode(tree1, ModelBuilder::noParent, 0, 0, 0.174108); - /* ModelBuilder::NodeId child12 = */ modelBuilder.addLeafNode(tree1, root1, 1, 4); + modelBuilder + .addSplitNode(tree1, ModelBuilder::noParent, 0, 0, 0.174108, defaultLeft, cover); + /* ModelBuilder::NodeId child12 = */ modelBuilder.addLeafNode(tree1, root1, 1, 4, cover); double proba11[] = { 0.8, 0.1, 0.0, 0.1, 0.0 }; - /* ModelBuilder::NodeId child11 = */ modelBuilder.addLeafNodeByProba(tree1, root1, 0, proba11); + /* ModelBuilder::NodeId child11 = */ modelBuilder.addLeafNodeByProba(tree1, + root1, + 0, + proba11, + cover); ModelBuilder::TreeId tree2 = modelBuilder.createTree(nNodes); ModelBuilder::NodeId root2 = - modelBuilder.addSplitNode(tree2, ModelBuilder::noParent, 0, 1, 0.571184); - /* ModelBuilder::NodeId child22 = */ modelBuilder.addLeafNode(tree2, root2, 1, 4); - /* ModelBuilder::NodeId child21 = */ modelBuilder.addLeafNode(tree2, root2, 0, 2); + modelBuilder + .addSplitNode(tree2, ModelBuilder::noParent, 0, 1, 0.571184, defaultLeft, cover); + /* ModelBuilder::NodeId child22 = */ modelBuilder.addLeafNode(tree2, root2, 1, 4, cover); + /* ModelBuilder::NodeId child21 = */ modelBuilder.addLeafNode(tree2, root2, 0, 2, cover); ModelBuilder::TreeId tree3 = modelBuilder.createTree(nNodes); ModelBuilder::NodeId root3 = - modelBuilder.addSplitNode(tree3, ModelBuilder::noParent, 0, 0, 0.303995); + modelBuilder + .addSplitNode(tree3, ModelBuilder::noParent, 0, 0, 0.303995, defaultLeft, cover); double proba32[] = { 0.05, 0.1, 0.0, 0.1, 0.75 }; - /* ModelBuilder::NodeId child32 = */ modelBuilder.addLeafNodeByProba(tree3, root3, 1, proba32); - /* ModelBuilder::NodeId child31 = */ modelBuilder.addLeafNode(tree3, root3, 0, 2); + /* ModelBuilder::NodeId child32 = */ modelBuilder.addLeafNodeByProba(tree3, + root3, + 1, + proba32, + cover); + /* ModelBuilder::NodeId child31 = */ modelBuilder.addLeafNode(tree3, root3, 0, 2, cover); modelBuilder.setNFeatures(nFeatures); return modelBuilder.getModel(); } diff --git a/examples/daal/cpp/source/decision_forest/df_cls_traversed_model_builder.cpp b/examples/daal/cpp/source/decision_forest/df_cls_traversed_model_builder.cpp index 2e02b25c7bb..22fd2756459 100644 --- a/examples/daal/cpp/source/decision_forest/df_cls_traversed_model_builder.cpp +++ b/examples/daal/cpp/source/decision_forest/df_cls_traversed_model_builder.cpp @@ -138,13 +138,17 @@ bool buildTree(size_t treeId, bool &isRoot, ModelBuilder &builder, std::map &parentMap) { + const int defaultLeft = 0; + const double cover = 0.0; if (node->left != NULL && node->right != NULL) { if (isRoot) { ModelBuilder::NodeId parent = builder.addSplitNode(treeId, ModelBuilder::noParent, 0, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); parentMap[node->left] = ParentPlace(parent, 0); ; @@ -158,7 +162,9 @@ bool buildTree(size_t treeId, p.parentId, p.place, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); parentMap[node->left] = ParentPlace(parent, 0); ; @@ -168,12 +174,12 @@ bool buildTree(size_t treeId, } else { if (isRoot) { - builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->classLabel); + builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->classLabel, cover); isRoot = false; } else { ParentPlace p = parentMap[node]; - builder.addLeafNode(treeId, p.parentId, p.place, node->classLabel); + builder.addLeafNode(treeId, p.parentId, p.place, node->classLabel, cover); } return true; } diff --git a/examples/daal/cpp/source/gradient_boosted_trees/gbt_cls_traversed_model_builder.cpp b/examples/daal/cpp/source/gradient_boosted_trees/gbt_cls_traversed_model_builder.cpp index 8170728cd10..6403dd5eccc 100644 --- a/examples/daal/cpp/source/gradient_boosted_trees/gbt_cls_traversed_model_builder.cpp +++ b/examples/daal/cpp/source/gradient_boosted_trees/gbt_cls_traversed_model_builder.cpp @@ -218,13 +218,17 @@ bool buildTree(size_t treeId, bool &isRoot, ModelBuilder &builder, const ParentPlace &parentPlace) { + const int defaultLeft = 0; + const double cover = 0.0; if (node->left != NULL && node->right != NULL) { if (isRoot) { ModelBuilder::NodeId parent = builder.addSplitNode(treeId, ModelBuilder::noParent, 0, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); isRoot = false; buildTree(treeId, node->left, isRoot, builder, ParentPlace(parent, 0)); @@ -235,7 +239,9 @@ bool buildTree(size_t treeId, parentPlace.parentId, parentPlace.place, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); buildTree(treeId, node->left, isRoot, builder, ParentPlace(parent, 0)); buildTree(treeId, node->right, isRoot, builder, ParentPlace(parent, 1)); @@ -243,11 +249,15 @@ bool buildTree(size_t treeId, } else { if (isRoot) { - builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->response); + builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->response, cover); isRoot = false; } else { - builder.addLeafNode(treeId, parentPlace.parentId, parentPlace.place, node->response); + builder.addLeafNode(treeId, + parentPlace.parentId, + parentPlace.place, + node->response, + cover); } } diff --git a/examples/daal/cpp/source/gradient_boosted_trees/gbt_reg_traversed_model_builder.cpp b/examples/daal/cpp/source/gradient_boosted_trees/gbt_reg_traversed_model_builder.cpp index c8bb826f398..9b7c7c8c964 100644 --- a/examples/daal/cpp/source/gradient_boosted_trees/gbt_reg_traversed_model_builder.cpp +++ b/examples/daal/cpp/source/gradient_boosted_trees/gbt_reg_traversed_model_builder.cpp @@ -216,13 +216,17 @@ bool buildTree(size_t treeId, bool &isRoot, ModelBuilder &builder, const ParentPlace &parentPlace) { + const int defaultLeft = 0; + const double cover = 0.0; if (node->left != NULL && node->right != NULL) { if (isRoot) { ModelBuilder::NodeId parent = builder.addSplitNode(treeId, ModelBuilder::noParent, 0, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); isRoot = false; buildTree(treeId, node->left, isRoot, builder, ParentPlace(parent, 0)); @@ -233,7 +237,9 @@ bool buildTree(size_t treeId, parentPlace.parentId, parentPlace.place, node->featureIndex, - node->featureValue); + node->featureValue, + defaultLeft, + cover); buildTree(treeId, node->left, isRoot, builder, ParentPlace(parent, 0)); buildTree(treeId, node->right, isRoot, builder, ParentPlace(parent, 1)); @@ -241,11 +247,15 @@ bool buildTree(size_t treeId, } else { if (isRoot) { - builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->response); + builder.addLeafNode(treeId, ModelBuilder::noParent, 0, node->response, cover); isRoot = false; } else { - builder.addLeafNode(treeId, parentPlace.parentId, parentPlace.place, node->response); + builder.addLeafNode(treeId, + parentPlace.parentId, + parentPlace.place, + node->response, + cover); } }