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

linear_model_training_types.h
1 /* file: linear_model_training_types.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 regression algorithm interface
21 //--
22 */
23 
24 #ifndef __LINEAR_MODEL_TRAINING_TYPES_H__
25 #define __LINEAR_MODEL_TRAINING_TYPES_H__
26 
27 #include "data_management/data/numeric_table.h"
28 #include "algorithms/algorithm_types.h"
29 #include "algorithms/regression/regression_training_types.h"
30 #include "algorithms/linear_model/linear_model_model.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace linear_model
37 {
47 namespace training
48 {
53 enum InputId
54 {
55  data = regression::training::data,
56  dependentVariables = regression::training::dependentVariables,
57  lastInputId = dependentVariables
58 };
59 
64 enum ResultId
65 {
66  model = regression::training::model,
67  lastResultId = model
68 };
69 
73 namespace interface1
74 {
79 class DAAL_EXPORT Input : public regression::training::Input
80 {
81 public:
86  Input(size_t nElements);
87  Input(const Input& other);
88 
89  virtual ~Input() {}
90 
96  data_management::NumericTablePtr get(InputId id) const;
97 
103  void set(InputId id, const data_management::NumericTablePtr &value);
104 };
105 
111 class DAAL_EXPORT PartialResult : public regression::training::PartialResult
112 {
113 public:
114  DAAL_CAST_OPERATOR(PartialResult)
119  PartialResult(size_t nElements = 0);
120 protected:
122  template<typename Archive, bool onDeserialize>
123  services::Status serialImpl(Archive *arch)
124  {
125  regression::training::PartialResult::serialImpl<Archive, onDeserialize>(arch);
126 
127  return services::Status();
128  }
129 
130  services::Status serializeImpl(data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE
131  {
132  serialImpl<data_management::InputDataArchive, false>(arch);
133 
134  return services::Status();
135  }
136 
137  services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE
138  {
139  serialImpl<const data_management::OutputDataArchive, true>(arch);
140 
141  return services::Status();
142  }
143 };
144 
150 class DAAL_EXPORT Result : public regression::training::Result
151 {
152 public:
153  DAAL_CAST_OPERATOR(Result)
158  Result(size_t nElements = 0);
159 
165  linear_model::ModelPtr get(ResultId id) const;
166 
172  void set(ResultId id, const linear_model::ModelPtr &value);
173 
182  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
183 
184 protected:
186  template<typename Archive, bool onDeserialize>
187  services::Status serialImpl(Archive *arch)
188  {
189  regression::training::Result::serialImpl<Archive, onDeserialize>(arch);
190 
191  return services::Status();
192  }
193 
194  services::Status serializeImpl(data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE
195  {
196  serialImpl<data_management::InputDataArchive, false>(arch);
197 
198  return services::Status();
199  }
200 
201  services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE
202  {
203  serialImpl<const data_management::OutputDataArchive, true>(arch);
204 
205  return services::Status();
206  }
207 };
208 typedef services::SharedPtr<Result> ResultPtr;
209 typedef services::SharedPtr<const Result> ResultConstPtr;
210 typedef services::SharedPtr<PartialResult> PartialResultPtr;
211 typedef services::SharedPtr<const PartialResult> PartialResultConstPtr;
212 }
213 using interface1::Input;
214 using interface1::Result;
215 using interface1::ResultPtr;
216 using interface1::ResultConstPtr;
217 using interface1::PartialResult;
218 using interface1::PartialResultPtr;
219 using interface1::PartialResultConstPtr;
220 }
222 }
223 }
224 }
225 #endif
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:111
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:150
daal::algorithms::linear_model::training::dependentVariables
Definition: linear_model_training_types.h:56
daal::algorithms::linear_model::training::ResultId
ResultId
Available identifiers of the result of regression model-based training.
Definition: linear_model_training_types.h:64
daal::algorithms::linear_model::training::data
Definition: linear_model_training_types.h:55
daal::algorithms::linear_model::training::InputId
InputId
Available identifiers of input objects for regression model-based training.
Definition: linear_model_training_types.h:53
daal::algorithms::linear_model::training::interface1::Input
Input objects for the regression model-based training
Definition: linear_model_training_types.h:79
daal::algorithms::linear_model::training::model
Definition: linear_model_training_types.h:66
daal::algorithms::regression::training::dependentVariables
Definition: regression_training_types.h:55
daal::algorithms::regression::training::data
Definition: regression_training_types.h:54
daal::algorithms::regression::training::model
Definition: regression_training_types.h:66
daal::algorithms::math::abs::value
Definition: abs_types.h:88

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