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

gbt_classification_training_types.h
1 /* file: gbt_classification_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 gradient boosted trees classification training algorithm interface.
21 //--
22 */
23 
24 #ifndef __GBT_CLASSIFICATION_TRAINING_TYPES_H__
25 #define __GBT_CLASSIFICATION_TRAINING_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "algorithms/classifier/classifier_training_types.h"
29 #include "algorithms/gradient_boosted_trees/gbt_classification_model.h"
30 #include "algorithms/gradient_boosted_trees/gbt_training_parameter.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace gbt
37 {
38 namespace classification
39 {
49 namespace training
50 {
55 enum Method
56 {
57  xboost = 0,
59  defaultDense = 0
60 };
61 
66 enum LossFunctionType
67 {
68  crossEntropy, /* Multinomial deviance */
69  custom /* custom function type */
70 };
71 
72 enum ResultNumericTableId
73 {
74  variableImportanceByWeight = classifier::training::lastResultId + 1,
75  variableImportanceByTotalCover,
76  variableImportanceByCover,
77  variableImportanceByTotalGain,
78  variableImportanceByGain,
79  lastResultNumericTableId = variableImportanceByGain
80 };
81 
82 
86 namespace interface1
87 {
94 /* [interface1::Parameter source code] */
95 struct DAAL_EXPORT Parameter : public classifier::interface1::Parameter, public daal::algorithms::gbt::training::Parameter
96 {
98  DAAL_DEPRECATED Parameter(size_t nClasses) : classifier::interface1::Parameter(nClasses), loss(crossEntropy) {}
99  DAAL_DEPRECATED services::Status check() const DAAL_C11_OVERRIDE;
100  LossFunctionType loss;
101 };
102 /* [interface1::Parameter source code] */
103 }
104 
108 namespace interface2
109 {
116 /* [Parameter source code] */
117 struct DAAL_EXPORT Parameter : public classifier::Parameter, public daal::algorithms::gbt::training::Parameter
118 {
120  Parameter(size_t nClasses) : classifier::Parameter(nClasses), loss(crossEntropy), varImportance(0) {}
121  services::Status check() const DAAL_C11_OVERRIDE;
122  LossFunctionType loss;
123  DAAL_UINT64 varImportance;
124 };
125 /* [Parameter source code] */
126 }
127 
128 namespace interface1
129 {
135 class DAAL_EXPORT Result : public classifier::training::Result
136 {
137 public:
138  DECLARE_SERIALIZABLE_CAST(Result);
139 
140  Result();
141  virtual ~Result() {}
142 
148  ModelPtr get(classifier::training::ResultId id) const;
149 
155  void set(classifier::training::ResultId id, const ModelPtr &value);
156 
162  data_management::NumericTablePtr get(ResultNumericTableId id) const;
163 
169  void set(ResultNumericTableId id, const data_management::NumericTablePtr &value);
170 
178  template <typename algorithmFPType>
179  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
180 
188  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
189 
190 protected:
192  template<typename Archive, bool onDeserialize>
193  services::Status serialImpl(Archive *arch)
194  {
195  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
196  }
197 };
198 typedef services::SharedPtr<Result> ResultPtr;
199 
200 } // namespace interface1
201 using interface2::Parameter;
202 using interface1::Result;
203 using interface1::ResultPtr;
204 
205 } // namespace daal::algorithms::gbt::classification::training
207 }
208 }
209 }
210 } // namespace daal
211 #endif // __GBT_CLASSIFICATION_TRAINING_TYPES_H__
daal::algorithms::gbt::classification::training::interface1::Parameter::Parameter
DAAL_DEPRECATED Parameter(size_t nClasses)
Definition: gbt_classification_training_types.h:98
daal::algorithms::gbt::classification::training::defaultDense
Definition: gbt_classification_training_types.h:59
daal::algorithms::gbt::classification::training::interface2::Parameter
Gradient Boosted Trees algorithm parameters.
Definition: gbt_classification_training_types.h:117
daal::algorithms::gbt::classification::training::interface1::Result
Provides methods to access the result obtained with the compute() method of model-based training...
Definition: gbt_classification_training_types.h:135
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::gbt::classification::training::LossFunctionType
LossFunctionType
Loss function type.
Definition: gbt_classification_training_types.h:66
daal::algorithms::gbt::classification::training::interface1::Parameter
Gradient Boosted Trees algorithm parameters.
Definition: gbt_classification_training_types.h:95
daal::algorithms::gbt::classification::training::Method
Method
Computation methods for gradient boosted trees classification model-based training.
Definition: gbt_classification_training_types.h:55
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::gbt::classification::training::xboost
Definition: gbt_classification_training_types.h:57
daal::algorithms::classifier::training::ResultId
ResultId
Definition: classifier_training_types.h:82
daal::algorithms::gbt::classification::training::interface2::Parameter::Parameter
Parameter(size_t nClasses)
Definition: gbt_classification_training_types.h:120

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