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

brownboost_predict.h
1 /* file: brownboost_predict.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 the interface for BrownBoost model-based prediction
19 //--
20 */
21 
22 #ifndef __BROWN_BOOST_PREDICT_H__
23 #define __BROWN_BOOST_PREDICT_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "algorithms/boosting/boosting_predict.h"
27 #include "algorithms/boosting/brownboost_model.h"
28 #include "algorithms/boosting/brownboost_predict_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace brownboost
35 {
39 namespace prediction
40 {
50 enum Method
51 {
52  defaultDense = 0
53 };
54 
58 namespace interface1
59 {
68 template<typename algorithmFPType, Method method, CpuType cpu>
69 class DAAL_EXPORT BatchContainer : public PredictionContainerIface
70 {
71 public:
76  BatchContainer(daal::services::Environment::env *daalEnv);
78  ~BatchContainer();
82  services::Status compute() DAAL_C11_OVERRIDE;
83 };
84 
104 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
105 class Batch : public boosting::prediction::Batch
106 {
107 public:
108  typedef boosting::prediction::Batch super;
109 
110  typedef algorithms::brownboost::prediction::Input InputType;
111  typedef algorithms::brownboost::Parameter ParameterType;
112  typedef typename super::ResultType ResultType;
113 
114  InputType input;
115  ParameterType parameter;
117  Batch()
118  {
119  initialize();
120  }
121 
128  Batch(const Batch<algorithmFPType, method> &other) : boosting::prediction::Batch(other),
129  input(other.input), parameter(other.parameter)
130  {
131  initialize();
132  }
133 
134  ~Batch() {}
135 
140  InputType * getInput() DAAL_C11_OVERRIDE { return &input; }
141 
146  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int)method; }
147 
153  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
154  {
155  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
156  }
157 
158 protected:
159  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
160  {
161  return new Batch<algorithmFPType, method>(*this);
162  }
163 
164  services::Status allocateResult() DAAL_C11_OVERRIDE
165  {
166  services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
167  _res = _result.get();
168  return s;
169  }
170 
171  void initialize()
172  {
173  _in = &input;
174  _ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
175  _par = &parameter;
176  }
177 };
178 } // namespace interface1
179 using interface1::BatchContainer;
180 using interface1::Batch;
181 
183 } // namespace daal::algorithms::brownboost::prediction
184 }
185 }
186 } // namespace daal
187 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::brownboost::prediction::interface1::BatchContainer
Provides methods to run implementations of the BrownBoost algorithm. This class is associated with da...
Definition: brownboost_predict.h:69
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:40
daal::algorithms::brownboost::prediction::Method
Method
Definition: brownboost_predict.h:50
daal::batch
Definition: daal_defines.h:106
daal::algorithms::brownboost::prediction::interface1::Batch
Predicts BrownBoost classification results.
Definition: brownboost_predict.h:105
daal::algorithms::brownboost::prediction::interface1::Batch::input
InputType input
Definition: brownboost_predict.h:114
daal::algorithms::brownboost::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: brownboost_predict.h:115
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::brownboost::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: brownboost_predict.h:153
daal::algorithms::brownboost::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: brownboost_predict.h:146
daal::algorithms::brownboost::prediction::defaultDense
Definition: brownboost_predict.h:52
daal::algorithms::brownboost::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: brownboost_predict.h:128
daal::algorithms::brownboost::prediction::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: brownboost_predict.h:140

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