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

gbt_regression_training_types.h
1 /* file: gbt_regression_training_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 gradient boosted trees regression training algorithm interface
45 //--
46 */
47 
48 #ifndef __GBT_REGRESSION_TRAINIG_TYPES_H__
49 #define __GBT_REGRESSION_TRAINIG_TYPES_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "data_management/data/data_serialize.h"
54 #include "services/daal_defines.h"
55 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
56 #include "algorithms/gradient_boosted_trees/gbt_training_parameter.h"
57 #include "algorithms/regression/regression_training_types.h"
58 
59 namespace daal
60 {
61 namespace algorithms
62 {
66 namespace gbt
67 {
68 namespace regression
69 {
79 namespace training
80 {
85 enum Method
86 {
87  xboost = 0,
89  defaultDense = 0
90 };
91 
96 enum LossFunctionType
97 {
98  squared, /* L(y,f) = ([y-f(x)]^2)/2 */
99  custom /* Should be differentiable up to the second order */
100 };
101 
106 enum InputId
107 {
108  data = algorithms::regression::training::data,
109  dependentVariable = algorithms::regression::training::dependentVariables,
110  lastInputId = dependentVariable
111 };
112 
117 enum ResultId
118 {
119  model = algorithms::regression::training::model,
120  lastResultId = model
121 };
122 
126 namespace interface1
127 {
134 /* [Parameter source code] */
135 class DAAL_EXPORT Parameter : public daal::algorithms::Parameter, public daal::algorithms::gbt::training::Parameter
136 {
137 public:
138  Parameter();
139  services::Status check() const DAAL_C11_OVERRIDE;
140 
141  LossFunctionType loss; /* Defaut is squared loss */
142 };
143 /* [Parameter source code] */
144 
149 class DAAL_EXPORT Input : public algorithms::regression::training::Input
150 {
151 public:
153  Input();
154 
156  Input(const Input& other) : algorithms::regression::training::Input(other){}
157 
158  virtual ~Input() {};
159 
165  data_management::NumericTablePtr get(InputId id) const;
166 
172  void set(InputId id, const data_management::NumericTablePtr &value);
173 
180  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
181 };
182 
188 class DAAL_EXPORT Result : public algorithms::regression::training::Result
189 {
190 public:
191  DECLARE_SERIALIZABLE_CAST(Result)
192  Result();
193 
201  template<typename algorithmFPType>
202  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const Parameter *parameter, const int method);
203 
209  gbt::regression::ModelPtr get(ResultId id) const;
210 
216  void set(ResultId id, const ModelPtr &value);
217 
225  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
226 
227 protected:
229  template<typename Archive, bool onDeserialize>
230  services::Status serialImpl(Archive *arch)
231  {
232  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
233  }
234 };
235 typedef services::SharedPtr<Result> ResultPtr;
236 
237 } // namespace interface1
238 using interface1::Parameter;
239 using interface1::Input;
240 using interface1::Result;
241 using interface1::ResultPtr;
242 
243 } // namespace training
245 } // namespace regression
246 }
247 }
248 } // namespace daal
249 #endif
daal::algorithms::regression::training::interface1::Result
Provides methods to access the result obtained with the compute() method of the regression model-base...
Definition: regression_training_types.h:168
daal::algorithms::regression::training::interface1::Input
Input objects for the regression model-based training
Definition: regression_training_types.h:102
daal::algorithms::gbt::regression::training::defaultDense
Definition: gbt_regression_training_types.h:89
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::gbt::regression::training::model
Definition: gbt_regression_training_types.h:119
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:188
daal::algorithms::gbt::regression::training::xboost
Definition: gbt_regression_training_types.h:87
daal_defines.h
daal::algorithms::regression::training::dependentVariables
Definition: regression_training_types.h:79
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::regression::training::model
Definition: regression_training_types.h:89
daal::algorithms::gbt::regression::training::interface1::Input
Input objects for model-based training
Definition: gbt_regression_training_types.h:149
daal::algorithms::gbt::regression::training::dependentVariable
Definition: gbt_regression_training_types.h:109
daal::algorithms::gbt::regression::training::LossFunctionType
LossFunctionType
Loss function type.
Definition: gbt_regression_training_types.h:96
daal::algorithms::gbt::regression::training::interface1::Parameter
Parameters for the gradient boosted trees algorithm.
Definition: gbt_regression_training_types.h:135
daal::algorithms::math::abs::value
Definition: abs_types.h:112
daal::algorithms::regression::training::data
Definition: regression_training_types.h:78
daal::algorithms::gbt::regression::training::ResultId
ResultId
Available identifiers of the result of model-based training.
Definition: gbt_regression_training_types.h:117
daal::algorithms::gbt::regression::training::InputId
InputId
Available identifiers of input objects for model-based training.
Definition: gbt_regression_training_types.h:106
daal::algorithms::gbt::regression::training::data
Definition: gbt_regression_training_types.h:108
daal::algorithms::interface1::Input
Base class to represent computation input arguments. Algorithm-specific input arguments are represent...
Definition: algorithm_types.h:217
daal::algorithms::gbt::training::interface1::Parameter
Parameters for the gradient boosted trees algorithm.
Definition: gbt_training_parameter.h:104
daal::algorithms::gbt::regression::training::interface1::Input::Input
Input(const Input &other)
Definition: gbt_regression_training_types.h:156
daal::algorithms::gbt::regression::training::Method
Method
Computation methods for gradient boosted trees classification model-based training.
Definition: gbt_regression_training_types.h:85

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