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

gbt_regression_training_types.h
1 /* file: gbt_regression_training_types.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 gradient boosted trees regression training algorithm interface
19 //--
20 */
21 
22 #ifndef __GBT_REGRESSION_TRAINIG_TYPES_H__
23 #define __GBT_REGRESSION_TRAINIG_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/data_serialize.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
30 #include "algorithms/gradient_boosted_trees/gbt_training_parameter.h"
31 #include "algorithms/regression/regression_training_types.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
40 namespace gbt
41 {
42 namespace regression
43 {
53 namespace training
54 {
59 enum Method
60 {
61  xboost = 0,
63  defaultDense = 0
64 };
65 
70 enum LossFunctionType
71 {
72  squared, /* L(y,f) = ([y-f(x)]^2)/2 */
73  custom /* Should be differentiable up to the second order */
74 };
75 
80 enum InputId
81 {
82  data = algorithms::regression::training::data,
83  dependentVariable = algorithms::regression::training::dependentVariables,
84  lastInputId = dependentVariable
85 };
86 
91 enum ResultId
92 {
93  model = algorithms::regression::training::model,
94  lastResultId = model
95 };
96 
100 namespace interface1
101 {
108 /* [Parameter source code] */
109 class DAAL_EXPORT Parameter : public daal::algorithms::Parameter, public daal::algorithms::gbt::training::Parameter
110 {
111 public:
112  Parameter();
113  services::Status check() const DAAL_C11_OVERRIDE;
114 
115  LossFunctionType loss; /* Defaut is squared loss */
116 };
117 /* [Parameter source code] */
118 
123 class DAAL_EXPORT Input : public algorithms::regression::training::Input
124 {
125 public:
127  Input();
128 
130  Input(const Input& other) : algorithms::regression::training::Input(other){}
131 
132  virtual ~Input() {};
133 
139  data_management::NumericTablePtr get(InputId id) const;
140 
146  void set(InputId id, const data_management::NumericTablePtr &value);
147 
154  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
155 };
156 
162 class DAAL_EXPORT Result : public algorithms::regression::training::Result
163 {
164 public:
165  DECLARE_SERIALIZABLE_CAST(Result)
166  Result();
167 
175  template<typename algorithmFPType>
176  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const Parameter *parameter, const int method);
177 
183  gbt::regression::ModelPtr get(ResultId id) const;
184 
190  void set(ResultId id, const ModelPtr &value);
191 
199  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
200 
201 protected:
203  template<typename Archive, bool onDeserialize>
204  services::Status serialImpl(Archive *arch)
205  {
206  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
207  }
208 };
209 typedef services::SharedPtr<Result> ResultPtr;
210 
211 } // namespace interface1
212 using interface1::Parameter;
213 using interface1::Input;
214 using interface1::Result;
215 using interface1::ResultPtr;
216 
217 } // namespace training
219 } // namespace regression
220 }
221 }
222 } // namespace daal
223 #endif
daal::algorithms::gbt::regression::training::Method
Method
Computation methods for gradient boosted trees classification model-based training.
Definition: gbt_regression_training_types.h:59
daal
Definition: algorithm_base_common.h:31
daal::algorithms::gbt::regression::training::interface1::Result
Provides methods to access the result obtained with the compute() method of model-based training...
Definition: gbt_regression_training_types.h:162
daal_defines.h
daal::algorithms::gbt::regression::training::xboost
Definition: gbt_regression_training_types.h:61
daal::algorithms::regression::training::model
Definition: regression_training_types.h:63
daal::algorithms::gbt::regression::training::interface1::Input
Input objects for model-based training
Definition: gbt_regression_training_types.h:123
daal::algorithms::gbt::regression::training::InputId
InputId
Available identifiers of input objects for model-based training.
Definition: gbt_regression_training_types.h:80
daal::algorithms::gbt::regression::training::model
Definition: gbt_regression_training_types.h:93
daal::algorithms::gbt::regression::training::dependentVariable
Definition: gbt_regression_training_types.h:83
daal::algorithms::gbt::regression::training::data
Definition: gbt_regression_training_types.h:82
daal::algorithms::gbt::regression::training::interface1::Parameter
Parameters for the gradient boosted trees algorithm.
Definition: gbt_regression_training_types.h:109
daal::algorithms::regression::training::dependentVariables
Definition: regression_training_types.h:53
daal::algorithms::regression::training::data
Definition: regression_training_types.h:52
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::gbt::regression::training::ResultId
ResultId
Available identifiers of the result of model-based training.
Definition: gbt_regression_training_types.h:91
daal::algorithms::gbt::regression::training::defaultDense
Definition: gbt_regression_training_types.h:63
daal::algorithms::gbt::regression::training::LossFunctionType
LossFunctionType
Loss function type.
Definition: gbt_regression_training_types.h:70
daal::algorithms::gbt::regression::training::interface1::Input::Input
Input(const Input &other)
Definition: gbt_regression_training_types.h:130

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