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

lasso_regression_predict.h
1 /* file: lasso_regression_predict.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 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 lasso regression model-based prediction
19 //--
20 */
21 
22 #ifndef __LASSO_REGRESSION_PREDICT_H__
23 #define __LASSO_REGRESSION_PREDICT_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "services/daal_defines.h"
27 #include "algorithms/lasso_regression/lasso_regression_predict_types.h"
28 #include "algorithms/linear_model/linear_model_predict.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace lasso_regression
35 {
36 namespace prediction
37 {
38 namespace interface1
39 {
58 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
59 class Batch : public linear_model::prediction::Batch<algorithmFPType, linear_model::prediction::defaultDense>
60 {
61 public:
62  typedef linear_model::prediction::Batch<algorithmFPType, linear_model::prediction::defaultDense> super;
63 
64  typedef algorithms::lasso_regression::prediction::Input InputType;
65  typedef typename super::ParameterType ParameterType;
66  typedef algorithms::lasso_regression::prediction::Result ResultType;
67 
68  InputType input;
71  Batch()
72  {
73  initialize();
74  }
75 
82  Batch(const Batch<algorithmFPType, defaultDense> &other) : input(other.input)
83  {
84  initialize();
85  }
86 
91  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int)defaultDense; }
92 
97  ResultPtr getResult() { return ResultType::cast(this->_result); }
98 
104  services::SharedPtr<Batch<algorithmFPType, defaultDense> > clone() const
105  {
106  return services::SharedPtr<Batch<algorithmFPType, defaultDense> >(cloneImpl());
107  }
108 
109  virtual regression::prediction::Input* getInput() DAAL_C11_OVERRIDE { return &input; }
110 
111 protected:
112 
113  virtual Batch<algorithmFPType, defaultDense> * cloneImpl() const DAAL_C11_OVERRIDE
114  {
115  return new Batch<algorithmFPType, defaultDense>(*this);
116  }
117 
118  services::Status allocateResult() DAAL_C11_OVERRIDE
119  {
120  services::Status s = getResult()->template allocate<algorithmFPType>(this->_in, 0, 0);
121  this->_res = this->_result.get();
122  return s;
123  }
124 
125  void initialize()
126  {
127  this->_ac = new __DAAL_ALGORITHM_CONTAINER(batch, linear_model::prediction::BatchContainer, algorithmFPType, linear_model::prediction::defaultDense)(&(this->_env));
128  this->_in = &input;
129  this->_par = NULL;
130  this->_result.reset(new ResultType());
131  }
132 };
134 } // namespace interface1
135 using interface1::Batch;
136 
137 } // namespace prediction
138 } // namespace lasso_regression
139 } // namespace algorithms
140 } // namespace daal
141 
142 #endif
daal::algorithms::lasso_regression::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, defaultDense > &other)
Definition: lasso_regression_predict.h:82
daal
Definition: algorithm_base_common.h:31
daal::algorithms::lasso_regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: lasso_regression_predict.h:97
daal::algorithms::lasso_regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, defaultDense > > clone() const
Definition: lasso_regression_predict.h:104
daal_defines.h
daal::algorithms::lasso_regression::prediction::interface1::Batch
Provides methods to run implementations of the lasso regression model-based prediction.
Definition: lasso_regression_predict.h:59
daal::batch
Definition: daal_defines.h:110
daal::algorithms::lasso_regression::prediction::interface1::Batch::input
InputType input
Definition: lasso_regression_predict.h:68
daal::algorithms::lasso_regression::prediction::interface1::Batch::Batch
Batch()
Definition: lasso_regression_predict.h:71
daal::algorithms::linear_model::prediction::defaultDense
Definition: linear_model_predict_types.h:53
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::lasso_regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: lasso_regression_predict.h:91

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