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

decision_tree_regression_model.h
1 /* file: decision_tree_regression_model.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the class defining the Decision tree regression model
45 //--
46 */
47 
48 #ifndef __DECISION_TREE_REGRESSION_MODEL_H__
49 #define __DECISION_TREE_REGRESSION_MODEL_H__
50 
51 #include "data_management/data/numeric_table.h"
52 #include "data_management/data/aos_numeric_table.h"
53 #include "data_management/data/soa_numeric_table.h"
54 #include "data_management/data/homogen_numeric_table.h"
55 #include "algorithms/model.h"
56 #include "decision_tree_model.h"
57 #include "algorithms/regression/regression_model.h"
58 #include "algorithms/regression/tree_traverse.h"
59 
60 using namespace daal::services;
61 
62 namespace daal
63 {
64 namespace algorithms
65 {
69 namespace decision_tree
70 {
79 namespace regression
80 {
81 
85 namespace interface1
86 {
97 /* [Parameter source code] */
98 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
99 {
103  Parameter() : daal::algorithms::Parameter(),
104  pruning(reducedErrorPruning), maxTreeDepth(0), minObservationsInLeafNodes(5)
105  {}
106 
110  services::Status check() const DAAL_C11_OVERRIDE;
111 
112  Pruning pruning;
113  size_t maxTreeDepth;
114  size_t minObservationsInLeafNodes;
115 };
116 /* [Parameter source code] */
117 
127 class DAAL_EXPORT Model : public algorithms::regression::Model
128 {
129 public:
130  DECLARE_MODEL_IFACE(Model, algorithms::regression::Model);
131 
136  Model();
137 
138  virtual ~Model();
139 
140  class ModelImpl;
141  typedef services::SharedPtr<ModelImpl> ModelImplPtr;
142 
147  const ModelImpl * impl() const { return _impl.get(); }
148 
153  ModelImpl * impl() { return _impl.get(); }
154 
159  static services::SharedPtr<Model> create(services::Status *stat = NULL);
160 
164  virtual size_t getNumberOfFeatures() const DAAL_C11_OVERRIDE;
165 
170  void traverseDF(algorithms::regression::TreeNodeVisitor& visitor) const;
171 
176  void traverseBF(algorithms::regression::TreeNodeVisitor& visitor) const;
177 
178 protected:
179  Model(services::Status &st);
180 
181  services::Status serializeImpl(data_management::InputDataArchive * arch) DAAL_C11_OVERRIDE;
182 
183  services::Status deserializeImpl(const data_management::OutputDataArchive * arch) DAAL_C11_OVERRIDE;
184 
185 private:
186  ModelImplPtr _impl;
187 };
188 
189 typedef services::SharedPtr<Model> ModelPtr;
190 typedef services::SharedPtr<const Model> ModelConstPtr;
191 
192 } // namespace interface1
193 
194 using interface1::Parameter;
195 using interface1::Model;
196 using interface1::ModelPtr;
197 using interface1::ModelConstPtr;
198 
200 } // namespace regression
201 } // namespace decision_tree
202 } // namespace algorithms
203 } // namespace daal
204 
205 #endif
daal::algorithms::decision_tree::regression::interface1::Parameter::Parameter
Parameter()
Definition: decision_tree_regression_model.h:103
daal
Definition: algorithm_base_common.h:57
daal::algorithms::decision_tree::reducedErrorPruning
Definition: decision_tree_model.h:76
daal::algorithms::decision_tree::regression::interface1::Parameter
Decision tree algorithm parameters.
Definition: decision_tree_regression_model.h:98
daal::algorithms::decision_tree::regression::interface1::Model::impl
const ModelImpl * impl() const
Definition: decision_tree_regression_model.h:147
daal::algorithms::decision_tree::Pruning
Pruning
Pruning method for Decision tree algorithm.
Definition: decision_tree_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:127
daal::algorithms::decision_tree::regression::interface1::Model::impl
ModelImpl * impl()
Definition: decision_tree_regression_model.h:153
daal::services
Contains classes that implement service functionality, including error handling, memory allocation...
Definition: collection.h:51

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