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

gbt_regression_training_types.h
1 /* file: gbt_regression_training_types.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 gradient boosted trees regression training algorithm interface
21 //--
22 */
23 
24 #ifndef __GBT_REGRESSION_TRAINIG_TYPES_H__
25 #define __GBT_REGRESSION_TRAINIG_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "data_management/data/data_serialize.h"
30 #include "services/daal_defines.h"
31 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
32 #include "algorithms/gradient_boosted_trees/gbt_training_parameter.h"
33 #include "algorithms/regression/regression_training_types.h"
34 
35 namespace daal
36 {
37 namespace algorithms
38 {
42 namespace gbt
43 {
44 namespace regression
45 {
55 namespace training
56 {
61 enum Method
62 {
63  xboost = 0,
65  defaultDense = 0
66 };
67 
72 enum LossFunctionType
73 {
74  squared, /* L(y,f) = ([y-f(x)]^2)/2 */
75  custom /* Should be differentiable up to the second order */
76 };
77 
82 enum InputId
83 {
84  data = algorithms::regression::training::data,
85  dependentVariable = algorithms::regression::training::dependentVariables,
86  lastInputId = dependentVariable
87 };
88 
93 enum ResultId
94 {
95  model = algorithms::regression::training::model,
96  lastResultId = model
97 };
98 
99 enum ResultNumericTableId
100 {
101  variableImportanceByWeight = lastResultId + 1,
102  variableImportanceByTotalCover,
103  variableImportanceByCover,
104  variableImportanceByTotalGain,
105  variableImportanceByGain,
106  lastResultNumericTableId = variableImportanceByGain
107 };
108 
112 namespace interface1
113 {
120 /* [Parameter source code] */
121 class DAAL_EXPORT Parameter : public daal::algorithms::Parameter, public daal::algorithms::gbt::training::Parameter
122 {
123 public:
124  Parameter();
125  services::Status check() const DAAL_C11_OVERRIDE;
126 
127  LossFunctionType loss;
128  DAAL_UINT64 varImportance;
129 };
130 /* [Parameter source code] */
131 
136 class DAAL_EXPORT Input : public algorithms::regression::training::Input
137 {
138 public:
140  Input();
141 
143  Input(const Input& other) : algorithms::regression::training::Input(other){}
144 
145  virtual ~Input() {};
146 
152  data_management::NumericTablePtr get(InputId id) const;
153 
159  void set(InputId id, const data_management::NumericTablePtr &value);
160 
167  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
168 };
169 
175 class DAAL_EXPORT Result : public algorithms::regression::training::Result
176 {
177 public:
178  DECLARE_SERIALIZABLE_CAST(Result)
179  Result();
180 
188  template<typename algorithmFPType>
189  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const Parameter *parameter, const int method);
190 
196  gbt::regression::ModelPtr get(ResultId id) const;
197 
203  void set(ResultId id, const ModelPtr &value);
204 
210  data_management::NumericTablePtr get(ResultNumericTableId id) const;
211 
217  void set(ResultNumericTableId id, const data_management::NumericTablePtr &value);
218 
226  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
227 
228 protected:
230  template<typename Archive, bool onDeserialize>
231  services::Status serialImpl(Archive *arch)
232  {
233  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
234  }
235 };
236 typedef services::SharedPtr<Result> ResultPtr;
237 
238 } // namespace interface1
239 using interface1::Parameter;
240 using interface1::Input;
241 using interface1::Result;
242 using interface1::ResultPtr;
243 
244 } // namespace training
246 } // namespace regression
247 }
248 }
249 } // namespace daal
250 #endif
daal::algorithms::gbt::regression::training::interface1::Parameter::varImportance
DAAL_UINT64 varImportance
Definition: gbt_regression_training_types.h:128
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:175
daal::algorithms::gbt::regression::training::model
Definition: gbt_regression_training_types.h:95
daal::algorithms::gbt::regression::training::dependentVariable
Definition: gbt_regression_training_types.h:85
daal::algorithms::gbt::regression::training::interface1::Parameter
Parameters for the gradient boosted trees algorithm.
Definition: gbt_regression_training_types.h:121
daal::algorithms::gbt::regression::training::LossFunctionType
LossFunctionType
Loss function type.
Definition: gbt_regression_training_types.h:72
daal::algorithms::gbt::regression::training::interface1::Input::Input
Input(const Input &other)
Definition: gbt_regression_training_types.h:143
daal::algorithms::regression::training::dependentVariables
Definition: regression_training_types.h:55
daal_defines.h
daal::algorithms::gbt::regression::training::Method
Method
Computation methods for gradient boosted trees classification model-based training.
Definition: gbt_regression_training_types.h:61
daal::algorithms::gbt::regression::training::InputId
InputId
Available identifiers of input objects for model-based training.
Definition: gbt_regression_training_types.h:82
daal::algorithms::gbt::regression::training::defaultDense
Definition: gbt_regression_training_types.h:65
daal::algorithms::regression::training::data
Definition: regression_training_types.h:54
daal::algorithms::gbt::regression::training::interface1::Input
Input objects for model-based training
Definition: gbt_regression_training_types.h:136
daal::algorithms::gbt::regression::training::interface1::Parameter::loss
LossFunctionType loss
Definition: gbt_regression_training_types.h:127
daal::algorithms::gbt::regression::training::ResultId
ResultId
Available identifiers of the result of model-based training.
Definition: gbt_regression_training_types.h:93
daal::algorithms::regression::training::model
Definition: regression_training_types.h:66
daal::algorithms::gbt::regression::training::data
Definition: gbt_regression_training_types.h:84
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::gbt::regression::training::xboost
Definition: gbt_regression_training_types.h:63

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