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

adaboost_model.h
1 /* file: adaboost_model.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 class defining Ada Boost model.
19 //--
20 */
21 
22 #ifndef __ADA_BOOST_MODEL_H__
23 #define __ADA_BOOST_MODEL_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/homogen_numeric_table.h"
27 #include "algorithms/boosting/boosting_model.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
36 namespace adaboost
37 {
41 namespace interface1
42 {
53 /* [Parameter source code] */
54 struct DAAL_EXPORT Parameter : public boosting::Parameter
55 {
57  Parameter();
58 
66  Parameter(services::SharedPtr<weak_learner::training::Batch> wlTrainForParameter,
67  services::SharedPtr<weak_learner::prediction::Batch> wlPredictForParameter,
68  double acc = 0.0, size_t maxIter = 10);
69 
70  double accuracyThreshold;
71  size_t maxIterations;
73  services::Status check() const DAAL_C11_OVERRIDE;
74 };
75 /* [Parameter source code] */
76 
85 class DAAL_EXPORT Model : public boosting::Model
86 {
87 public:
88  DECLARE_MODEL(Model, classifier::Model)
89 
90 
97  template <typename modelFPType>
98  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy);
99 
104  Model() : boosting::Model(), _alpha() {}
105 
112  template<typename modelFPType>
113  DAAL_EXPORT static services::SharedPtr<Model> create(size_t nFeatures, services::Status *stat = NULL);
114 
115  virtual ~Model() { }
116 
123  data_management::NumericTablePtr getAlpha() const;
124 
125 protected:
126  data_management::NumericTablePtr _alpha; /* Boosting coefficients table */
127 
128  template<typename Archive, bool onDeserialize>
129  services::Status serialImpl(Archive *arch)
130  {
131  services::Status st = boosting::Model::serialImpl<Archive, onDeserialize>(arch);
132  if (!st)
133  return st;
134  arch->setSharedPtrObj(_alpha);
135 
136  return st;
137  }
138 
139  template <typename modelFPType>
140  DAAL_EXPORT Model(size_t nFeatures, modelFPType dummy, services::Status &st);
141 
142 }; // class Model
143 typedef services::SharedPtr<Model> ModelPtr;
145 } // namespace interface1
146 using interface1::Parameter;
147 using interface1::Model;
148 using interface1::ModelPtr;
149 
150 } // namespace adaboost
151 } // namespace algorithms
152 } // namespace daal
153 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::adaboost::interface1::Model
Model of the classifier trained by the adaboost::training::Batch algorithm.
Definition: adaboost_model.h:85
daal::algorithms::adaboost::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: adaboost_model.h:70
daal::algorithms::adaboost::interface1::Parameter
AdaBoost algorithm parameters.
Definition: adaboost_model.h:54
daal::algorithms::adaboost::interface1::Parameter::maxIterations
size_t maxIterations
Definition: adaboost_model.h:71
daal::algorithms::adaboost::interface1::Model::Model
Model()
Definition: adaboost_model.h:104

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