C++ API Reference for Intel® Data Analytics Acceleration Library 2019

decision_tree_regression_model.h
1 /* file: decision_tree_regression_model.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the class defining the Decision tree regression model
19 //--
20 */
21 
22 #ifndef __DECISION_TREE_REGRESSION_MODEL_H__
23 #define __DECISION_TREE_REGRESSION_MODEL_H__
24 
25 #include "data_management/data/numeric_table.h"
26 #include "data_management/data/aos_numeric_table.h"
27 #include "data_management/data/soa_numeric_table.h"
28 #include "data_management/data/homogen_numeric_table.h"
29 #include "algorithms/model.h"
30 #include "decision_tree_model.h"
31 #include "algorithms/regression/regression_model.h"
32 #include "algorithms/regression/tree_traverse.h"
33 #include "algorithms/tree_utils/tree_utils_regression.h"
34 
35 namespace daal
36 {
37 namespace algorithms
38 {
42 namespace decision_tree
43 {
52 namespace regression
53 {
54 
58 namespace interface1
59 {
70 /* [Parameter source code] */
71 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
72 {
76  Parameter() : daal::algorithms::Parameter(),
77  pruning(reducedErrorPruning), maxTreeDepth(0), minObservationsInLeafNodes(5)
78  {}
79 
83  services::Status check() const DAAL_C11_OVERRIDE;
84 
85  Pruning pruning;
86  size_t maxTreeDepth;
87  size_t minObservationsInLeafNodes;
88 };
89 /* [Parameter source code] */
90 
100 class DAAL_EXPORT Model : public algorithms::regression::Model
101 {
102 public:
103  DECLARE_MODEL_IFACE(Model, algorithms::regression::Model);
104 
109  Model();
110 
111  virtual ~Model();
112 
113  class ModelImpl;
114  typedef services::SharedPtr<ModelImpl> ModelImplPtr;
115 
120  const ModelImpl * impl() const { return _impl.get(); }
121 
126  ModelImpl * impl() { return _impl.get(); }
127 
132  static services::SharedPtr<Model> create(services::Status *stat = NULL);
133 
137  virtual size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE;
138 
144  void traverseDF(algorithms::regression::TreeNodeVisitor& visitor) const;
145 
151  void traverseBF(algorithms::regression::TreeNodeVisitor& visitor) const;
152 
157  void traverseDFS(tree_utils::regression::TreeNodeVisitor& visitor) const;
158 
163  void traverseBFS(tree_utils::regression::TreeNodeVisitor& visitor) const;
164 
165 protected:
166  Model(services::Status &st);
167 
168  services::Status serializeImpl(data_management::InputDataArchive * arch) DAAL_C11_OVERRIDE;
169 
170  services::Status deserializeImpl(const data_management::OutputDataArchive * arch) DAAL_C11_OVERRIDE;
171 
172 private:
173  ModelImplPtr _impl;
174 };
175 
176 typedef services::SharedPtr<Model> ModelPtr;
177 typedef services::SharedPtr<const Model> ModelConstPtr;
178 
179 } // namespace interface1
180 
181 using interface1::Parameter;
182 using interface1::Model;
183 using interface1::ModelPtr;
184 using interface1::ModelConstPtr;
185 
187 } // namespace regression
188 } // namespace decision_tree
189 } // namespace algorithms
190 } // namespace daal
191 
192 #endif
daal::algorithms::decision_tree::regression::interface1::Parameter::Parameter
Parameter()
Definition: decision_tree_regression_model.h:76
daal
Definition: algorithm_base_common.h:31
daal::algorithms::decision_tree::reducedErrorPruning
Definition: decision_tree_model.h:50
daal::algorithms::decision_tree::regression::interface1::Parameter
Decision tree algorithm parameters.
Definition: decision_tree_regression_model.h:71
daal::algorithms::decision_tree::regression::interface1::Model::impl
const ModelImpl * impl() const
Definition: decision_tree_regression_model.h:120
daal::algorithms::decision_tree::Pruning
Pruning
Pruning method for Decision tree algorithm.
Definition: decision_tree_model.h:47
daal::algorithms::decision_tree::regression::interface1::Model
Base class for models trained with the Decision tree algorithm
Definition: decision_tree_regression_model.h:100
daal::algorithms::decision_tree::regression::interface1::Model::impl
ModelImpl * impl()
Definition: decision_tree_regression_model.h:126

For more complete information about compiler optimizations, see our Optimization Notice.