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

regression_predict.h
1 /* file: regression_predict.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 the interface for the regression model-based prediction
21 //--
22 */
23 
24 #ifndef __REGRESSION_PREDICT_H__
25 #define __REGRESSION_PREDICT_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "algorithms/regression/regression_predict_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace regression
35 {
36 namespace prediction
37 {
38 namespace interface1
39 {
53 class Batch : public daal::algorithms::Prediction
54 {
55 public:
56  typedef algorithms::regression::prediction::Input InputType;
57  typedef algorithms::Parameter ParameterType;
58  typedef algorithms::regression::prediction::Result ResultType;
59 
60  virtual ~Batch() {}
61  virtual InputType* getInput() = 0;
62 
69  services::Status setResult(const ResultPtr& res)
70  {
71  DAAL_CHECK(res, services::ErrorNullResult)
72  _result = res;
73  _res = _result.get();
74  return services::Status();
75  }
76 
81  ResultPtr getResult() { return _result; }
82 
88  services::SharedPtr<Batch> clone() const
89  {
90  return services::SharedPtr<Batch>(cloneImpl());
91  }
92 
93 protected:
94  ResultPtr _result;
95  virtual Batch * cloneImpl() const DAAL_C11_OVERRIDE = 0;
96 };
98 }
99 using interface1::Batch;
100 }
101 }
102 }
103 }
104 #endif
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::regression::prediction::interface1::Batch
Provides methods to run implementations of the regression model-based prediction. ...
Definition: regression_predict.h:53
daal::algorithms::regression::prediction::interface1::Batch::setResult
services::Status setResult(const ResultPtr &res)
Definition: regression_predict.h:69
daal::algorithms::regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: regression_predict.h:88
daal::algorithms::regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: regression_predict.h:81
daal::algorithms::Prediction
Provides prediction methods depending on the model such as linear_regression::Model. The methods of the class support different computation modes: batch, distributed, and online(see ComputeMode). Classes that implement specific algorithms of the model based data prediction are derived classes of the Prediction class. The class additionally provides virtual methods for validation of input and output parameters of the algorithms.
Definition: prediction.h:52

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