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

linear_model_training_types.h
1 /* file: linear_model_training_types.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 regression algorithm interface
19 //--
20 */
21 
22 #ifndef __LINEAR_MODEL_TRAINING_TYPES_H__
23 #define __LINEAR_MODEL_TRAINING_TYPES_H__
24 
25 #include "data_management/data/numeric_table.h"
26 #include "algorithms/algorithm_types.h"
27 #include "algorithms/regression/regression_training_types.h"
28 #include "algorithms/linear_model/linear_model_model.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace linear_model
35 {
45 namespace training
46 {
51 enum InputId
52 {
53  data = regression::training::data,
54  dependentVariables = regression::training::dependentVariables,
55  lastInputId = dependentVariables
56 };
57 
62 enum ResultId
63 {
64  model = regression::training::model,
65  lastResultId = model
66 };
67 
71 namespace interface1
72 {
77 class DAAL_EXPORT Input : public regression::training::Input
78 {
79 public:
84  Input(size_t nElements);
85  Input(const Input& other);
86 
87  virtual ~Input() {}
88 
94  data_management::NumericTablePtr get(InputId id) const;
95 
101  void set(InputId id, const data_management::NumericTablePtr &value);
102 };
103 
109 class DAAL_EXPORT PartialResult : public regression::training::PartialResult
110 {
111 public:
112  DAAL_CAST_OPERATOR(PartialResult)
117  PartialResult(size_t nElements = 0);
118 protected:
120  template<typename Archive, bool onDeserialize>
121  services::Status serialImpl(Archive *arch)
122  {
123  regression::training::PartialResult::serialImpl<Archive, onDeserialize>(arch);
124 
125  return services::Status();
126  }
127 
128  services::Status serializeImpl(data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE
129  {
130  serialImpl<data_management::InputDataArchive, false>(arch);
131 
132  return services::Status();
133  }
134 
135  services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE
136  {
137  serialImpl<const data_management::OutputDataArchive, true>(arch);
138 
139  return services::Status();
140  }
141 };
142 
148 class DAAL_EXPORT Result : public regression::training::Result
149 {
150 public:
151  DAAL_CAST_OPERATOR(Result)
156  Result(size_t nElements = 0);
157 
163  linear_model::ModelPtr get(ResultId id) const;
164 
170  void set(ResultId id, const linear_model::ModelPtr &value);
171 
180  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
181 
182 protected:
184  template<typename Archive, bool onDeserialize>
185  services::Status serialImpl(Archive *arch)
186  {
187  regression::training::Result::serialImpl<Archive, onDeserialize>(arch);
188 
189  return services::Status();
190  }
191 
192  services::Status serializeImpl(data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE
193  {
194  serialImpl<data_management::InputDataArchive, false>(arch);
195 
196  return services::Status();
197  }
198 
199  services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE
200  {
201  serialImpl<const data_management::OutputDataArchive, true>(arch);
202 
203  return services::Status();
204  }
205 };
206 typedef services::SharedPtr<Result> ResultPtr;
207 typedef services::SharedPtr<const Result> ResultConstPtr;
208 typedef services::SharedPtr<PartialResult> PartialResultPtr;
209 typedef services::SharedPtr<const PartialResult> PartialResultConstPtr;
210 }
211 using interface1::Input;
212 using interface1::Result;
213 using interface1::ResultPtr;
214 using interface1::ResultConstPtr;
215 using interface1::PartialResult;
216 using interface1::PartialResultPtr;
217 using interface1::PartialResultConstPtr;
218 }
220 }
221 }
222 }
223 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::linear_model::training::interface1::Result
Provides methods to access the result obtained with the compute() method of the regression model-base...
Definition: linear_model_training_types.h:148
daal::algorithms::linear_model::training::interface1::Input
Input objects for the regression model-based training
Definition: linear_model_training_types.h:77
daal::algorithms::regression::training::model
Definition: regression_training_types.h:63
daal::algorithms::linear_model::training::dependentVariables
Definition: linear_model_training_types.h:54
daal::algorithms::linear_model::training::model
Definition: linear_model_training_types.h:64
daal::algorithms::linear_model::training::interface1::PartialResult
Provides methods to access a partial result obtained with the compute() method of the linear model-ba...
Definition: linear_model_training_types.h:109
daal::algorithms::linear_model::training::data
Definition: linear_model_training_types.h:53
daal::algorithms::regression::training::dependentVariables
Definition: regression_training_types.h:53
daal::algorithms::regression::training::data
Definition: regression_training_types.h:52
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::linear_model::training::InputId
InputId
Available identifiers of input objects for regression model-based training.
Definition: linear_model_training_types.h:51
daal::algorithms::linear_model::training::ResultId
ResultId
Available identifiers of the result of regression model-based training.
Definition: linear_model_training_types.h:62

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