C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

decision_tree_regression_model.h
1 /* file: decision_tree_regression_model.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of the class defining the Decision tree regression model
21 //--
22 */
23 
24 #ifndef __DECISION_TREE_REGRESSION_MODEL_H__
25 #define __DECISION_TREE_REGRESSION_MODEL_H__
26 
27 #include "data_management/data/numeric_table.h"
28 #include "data_management/data/aos_numeric_table.h"
29 #include "data_management/data/soa_numeric_table.h"
30 #include "data_management/data/homogen_numeric_table.h"
31 #include "algorithms/model.h"
32 #include "decision_tree_model.h"
33 #include "algorithms/regression/regression_model.h"
34 #include "algorithms/regression/tree_traverse.h"
35 #include "algorithms/tree_utils/tree_utils_regression.h"
36 
37 namespace daal
38 {
39 namespace algorithms
40 {
44 namespace decision_tree
45 {
54 namespace regression
55 {
56 
60 namespace interface1
61 {
72 /* [Parameter source code] */
73 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
74 {
78  Parameter() : daal::algorithms::Parameter(),
79  pruning(reducedErrorPruning), maxTreeDepth(0), minObservationsInLeafNodes(5)
80  {}
81 
85  services::Status check() const DAAL_C11_OVERRIDE;
86 
87  Pruning pruning;
88  size_t maxTreeDepth;
89  size_t minObservationsInLeafNodes;
90 };
91 /* [Parameter source code] */
92 
102 class DAAL_EXPORT Model : public algorithms::regression::Model
103 {
104 public:
105  DECLARE_MODEL_IFACE(Model, algorithms::regression::Model);
106 
111  Model();
112 
113  virtual ~Model();
114 
115  class ModelImpl;
116  typedef services::SharedPtr<ModelImpl> ModelImplPtr;
117 
122  const ModelImpl * impl() const { return _impl.get(); }
123 
128  ModelImpl * impl() { return _impl.get(); }
129 
134  static services::SharedPtr<Model> create(services::Status *stat = NULL);
135 
139  virtual size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE;
140 
146  void traverseDF(algorithms::regression::TreeNodeVisitor& visitor) const;
147 
153  void traverseBF(algorithms::regression::TreeNodeVisitor& visitor) const;
154 
159  void traverseDFS(tree_utils::regression::TreeNodeVisitor& visitor) const;
160 
165  void traverseBFS(tree_utils::regression::TreeNodeVisitor& visitor) const;
166 
167 protected:
168  Model(services::Status &st);
169 
170  services::Status serializeImpl(data_management::InputDataArchive * arch) DAAL_C11_OVERRIDE;
171 
172  services::Status deserializeImpl(const data_management::OutputDataArchive * arch) DAAL_C11_OVERRIDE;
173 
174 private:
175  ModelImplPtr _impl;
176 };
177 
178 typedef services::SharedPtr<Model> ModelPtr;
179 typedef services::SharedPtr<const Model> ModelConstPtr;
180 
181 } // namespace interface1
182 
183 using interface1::Parameter;
184 using interface1::Model;
185 using interface1::ModelPtr;
186 using interface1::ModelConstPtr;
187 
189 } // namespace regression
190 } // namespace decision_tree
191 } // namespace algorithms
192 } // namespace daal
193 
194 #endif
daal::algorithms::decision_tree::regression::interface1::Model::impl
const ModelImpl * impl() const
Definition: decision_tree_regression_model.h:122
daal::algorithms::decision_tree::reducedErrorPruning
Definition: decision_tree_model.h:52
daal::algorithms::decision_tree::regression::interface1::Model::impl
ModelImpl * impl()
Definition: decision_tree_regression_model.h:128
daal::algorithms::decision_tree::Pruning
Pruning
Pruning method for Decision tree algorithm.
Definition: decision_tree_model.h:49
daal::algorithms::decision_tree::regression::interface1::Parameter::Parameter
Parameter()
Definition: decision_tree_regression_model.h:78
daal::algorithms::decision_tree::regression::interface1::Parameter
Decision tree algorithm parameters.
Definition: decision_tree_regression_model.h:73
daal::algorithms::decision_tree::regression::interface1::Model
Base class for models trained with the Decision tree algorithm
Definition: decision_tree_regression_model.h:102

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