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

gbt_regression_predict_types.h
1 /* file: gbt_regression_predict_types.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 gradient boosted trees algorithm interface
45 //--
46 */
47 
48 #ifndef __GBT_REGRESSSION_PREDICT_TYPES_H__
49 #define __GBT_REGRESSSION_PREDICT_TYPES_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "algorithms/regression/regression_predict_types.h"
54 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
55 
56 namespace daal
57 {
58 namespace algorithms
59 {
63 namespace gbt
64 {
65 namespace regression
66 {
76 namespace prediction
77 {
82 enum Method
83 {
84  defaultDense = 0
85 };
86 
91 enum NumericTableInputId
92 {
93  data = algorithms::regression::prediction::data,
94  lastNumericTableInputId = data
95 };
96 
101 enum ModelInputId
102 {
103  model = algorithms::regression::prediction::model,
104  lastModelInputId = model
105 };
106 
111 enum ResultId
112 {
113  prediction = algorithms::regression::prediction::prediction,
114  lastResultId = prediction
115 };
116 
120 namespace interface1
121 {
122 
129 /* [Parameter source code] */
130 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
131 {
132  Parameter() : daal::algorithms::Parameter(), nIterations(0) {}
133  Parameter(const Parameter& o) : daal::algorithms::Parameter(o), nIterations(o.nIterations){}
134  size_t nIterations;
135 };
136 /* [Parameter source code] */
137 
142 class DAAL_EXPORT Input : public algorithms::regression::prediction::Input
143 {
144 public:
145  Input();
146  Input(const Input& other);
147 
153  data_management::NumericTablePtr get(NumericTableInputId id) const;
154 
160  gbt::regression::ModelPtr get(ModelInputId id) const;
161 
167  void set(NumericTableInputId id, const data_management::NumericTablePtr &value);
168 
174  void set(ModelInputId id, const gbt::regression::ModelPtr &value);
175 
180  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
181 };
182 
187 class DAAL_EXPORT Result : public algorithms::regression::prediction::Result
188 {
189 public:
190  DECLARE_SERIALIZABLE_CAST(Result)
191  Result();
192 
198  data_management::NumericTablePtr get(ResultId id) const;
199 
205  void set(ResultId id, const data_management::NumericTablePtr &value);
206 
214  template <typename algorithmFPType>
215  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
216 
224  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
225 
226 protected:
228  template<typename Archive, bool onDeserialize>
229  services::Status serialImpl(Archive *arch)
230  {
231  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
232  }
233 };
234 typedef services::SharedPtr<Result> ResultPtr;
235 typedef services::SharedPtr<const Result> ResultConstPtr;
236 
237 } // namespace interface1
238 using interface1::Parameter;
239 using interface1::Input;
240 using interface1::Result;
241 using interface1::ResultPtr;
242 using interface1::ResultConstPtr;
243 
244 }
246 }
247 }
248 }
249 } // namespace daal
250 #endif
daal
Definition: algorithm_base_common.h:57
daal::algorithms::gbt::regression::prediction::interface1::Result
Provides interface for the result of model-based prediction.
Definition: gbt_regression_predict_types.h:187
daal::algorithms::gbt::regression::prediction::ModelInputId
ModelInputId
Available identifiers of input models for making model-based prediction.
Definition: gbt_regression_predict_types.h:101
daal::algorithms::gbt::regression::prediction::Method
Method
Available methods for making model-based prediction.
Definition: gbt_regression_predict_types.h:82
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:123
daal::algorithms::gbt::regression::prediction::data
Definition: gbt_regression_predict_types.h:93
daal::algorithms::gbt::regression::prediction::interface1::Input
Provides an interface for input objects for making model-based prediction.
Definition: gbt_regression_predict_types.h:142
daal::algorithms::gbt::regression::prediction::interface1::Parameter::nIterations
size_t nIterations
Definition: gbt_regression_predict_types.h:134
daal::algorithms::gbt::regression::prediction::prediction
Definition: gbt_regression_predict_types.h:113
daal::algorithms::gbt::regression::prediction::model
Definition: gbt_regression_predict_types.h:103
daal::algorithms::regression::prediction::prediction
Definition: regression_predict_types.h:98
daal::algorithms::gbt::regression::prediction::NumericTableInputId
NumericTableInputId
Available identifiers of input numeric tables for making model-based prediction.
Definition: gbt_regression_predict_types.h:91
daal::algorithms::regression::prediction::data
Definition: regression_predict_types.h:78
daal::algorithms::math::abs::value
Definition: abs_types.h:112
daal::algorithms::gbt::regression::prediction::ResultId
ResultId
Available identifiers of the result for making model-based prediction.
Definition: gbt_regression_predict_types.h:111
daal::algorithms::gbt::regression::prediction::interface1::Parameter
Parameters of the prediction algorithm.
Definition: gbt_regression_predict_types.h:130
daal::algorithms::regression::prediction::model
Definition: regression_predict_types.h:88
daal::algorithms::gbt::regression::prediction::defaultDense
Definition: gbt_regression_predict_types.h:84

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