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

logistic_regression_training_types.h
1 /* file: logistic_regression_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 logistic regression training algorithm interface.
21 //--
22 */
23 
24 #ifndef __LOGISTIC_REGRESSION_TRAINING_TYPES_H__
25 #define __LOGISTIC_REGRESSION_TRAINING_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "algorithms/classifier/classifier_training_types.h"
29 #include "algorithms/logistic_regression/logistic_regression_model.h"
30 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace logistic_regression
37 {
47 namespace training
48 {
53 enum Method
54 {
55  defaultDense = 0
56 };
57 
61 namespace interface1
62 {
69 /* [interface1::Parameter source code] */
70 struct DAAL_EXPORT Parameter : public classifier::interface1::Parameter
71 {
72  typedef optimization_solver::iterative_solver::interface1::BatchPtr SolverPtr;
73 
75  DAAL_DEPRECATED Parameter(size_t nClasses, const SolverPtr& solver = SolverPtr());
76  DAAL_DEPRECATED Parameter(const Parameter& o) : classifier::interface1::Parameter(o), interceptFlag(o.interceptFlag),
77  penaltyL1(o.penaltyL1), penaltyL2(o.penaltyL2), optimizationSolver(o.optimizationSolver){}
78  services::Status check() const DAAL_C11_OVERRIDE;
79 
80  bool interceptFlag;
81  float penaltyL1;
82  float penaltyL2;
83  SolverPtr optimizationSolver;
84 };
85 /* [interface1::Parameter source code] */
86 
92 class DAAL_EXPORT Result : public classifier::training::Result
93 {
94 public:
95  DECLARE_SERIALIZABLE_CAST(Result);
96 
97  DAAL_DEPRECATED Result();
98  DAAL_DEPRECATED_VIRTUAL virtual ~Result() {}
99 
105  DAAL_DEPRECATED ModelPtr get(classifier::training::ResultId id) const;
106 
112  DAAL_DEPRECATED void set(classifier::training::ResultId id, const ModelPtr &value);
113 
121  template <typename algorithmFPType>
122  DAAL_EXPORT DAAL_DEPRECATED services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
123 
131  DAAL_DEPRECATED services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
132 
133 protected:
135  template<typename Archive, bool onDeserialize>
136  services::Status serialImpl(Archive *arch)
137  {
138  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
139  }
140 };
141 typedef services::SharedPtr<Result> ResultPtr;
142 
143 } // namespace interface1
144 
148 namespace interface2
149 {
156 /* [interface2::Parameter source code] */
157 struct DAAL_EXPORT Parameter : public classifier::interface1::Parameter
158 {
159  typedef optimization_solver::iterative_solver::BatchPtr SolverPtr;
160 
162  DAAL_DEPRECATED Parameter(size_t nClasses, const SolverPtr& solver = SolverPtr());
163  DAAL_DEPRECATED Parameter(const Parameter& o) : classifier::interface1::Parameter(o), interceptFlag(o.interceptFlag),
164  penaltyL1(o.penaltyL1), penaltyL2(o.penaltyL2), optimizationSolver(o.optimizationSolver){}
165  services::Status check() const DAAL_C11_OVERRIDE;
166 
167  bool interceptFlag;
168  float penaltyL1;
169  float penaltyL2;
170  SolverPtr optimizationSolver;
171 };
172 /* [interface2::Parameter source code] */
173 
179 class DAAL_EXPORT Result : public classifier::training::Result
180 {
181 public:
182  DECLARE_SERIALIZABLE_CAST(Result);
183 
184  Result();
185  virtual ~Result() {}
186 
192  ModelPtr get(classifier::training::ResultId id) const;
193 
199  void set(classifier::training::ResultId id, const ModelPtr &value);
200 
208  template <typename algorithmFPType>
209  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
210 
218  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
219 
220 protected:
222  template<typename Archive, bool onDeserialize>
223  services::Status serialImpl(Archive *arch)
224  {
225  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
226  }
227 };
228 typedef services::SharedPtr<Result> ResultPtr;
229 
230 } // namespace interface2
231 using interface2::Result;
232 using interface2::ResultPtr;
233 
234 namespace interface3
235 {
242 /* [Parameter source code] */
243 struct DAAL_EXPORT Parameter : public classifier::Parameter
244 {
245  typedef optimization_solver::iterative_solver::BatchPtr SolverPtr;
246 
248  Parameter(size_t nClasses, const SolverPtr& solver = SolverPtr());
249  Parameter(const Parameter& o) : classifier::Parameter(o), interceptFlag(o.interceptFlag),
250  penaltyL1(o.penaltyL1), penaltyL2(o.penaltyL2), optimizationSolver(o.optimizationSolver){}
251  services::Status check() const DAAL_C11_OVERRIDE;
252 
253  bool interceptFlag;
254  float penaltyL1;
255  float penaltyL2;
256  SolverPtr optimizationSolver;
257 };
258 /* [Parameter source code] */
259 }
260 using interface3::Parameter;
261 
262 } // namespace daal::algorithms::logistic_regression::training
264 }
265 }
266 } // namespace daal
267 #endif // __LOGISTIC_REGRESSION_TRAINING_TYPES_H__
daal::algorithms::logistic_regression::training::interface2::Result
Provides methods to access the result obtained with the compute() method of model-based training...
Definition: logistic_regression_training_types.h:179
daal::algorithms::logistic_regression::training::interface2::Parameter::penaltyL1
float penaltyL1
Definition: logistic_regression_training_types.h:168
daal::algorithms::logistic_regression::training::interface2::Parameter
logistic regression algorithm parameters
Definition: logistic_regression_training_types.h:157
daal::algorithms::logistic_regression::training::interface3::Parameter::optimizationSolver
SolverPtr optimizationSolver
Definition: logistic_regression_training_types.h:256
daal::algorithms::logistic_regression::training::interface3::Parameter::penaltyL1
float penaltyL1
Definition: logistic_regression_training_types.h:254
daal::algorithms::logistic_regression::training::interface1::Parameter::optimizationSolver
SolverPtr optimizationSolver
Definition: logistic_regression_training_types.h:83
daal::algorithms::logistic_regression::training::interface1::Parameter::penaltyL1
float penaltyL1
Definition: logistic_regression_training_types.h:81
daal::algorithms::logistic_regression::training::defaultDense
Definition: logistic_regression_training_types.h:55
daal::algorithms::logistic_regression::training::interface3::Parameter::interceptFlag
bool interceptFlag
Definition: logistic_regression_training_types.h:253
daal::algorithms::logistic_regression::training::interface2::Parameter::optimizationSolver
SolverPtr optimizationSolver
Definition: logistic_regression_training_types.h:170
daal::algorithms::logistic_regression::training::interface2::Parameter::interceptFlag
bool interceptFlag
Definition: logistic_regression_training_types.h:167
daal::algorithms::logistic_regression::training::interface1::Parameter::penaltyL2
float penaltyL2
Definition: logistic_regression_training_types.h:82
daal::algorithms::logistic_regression::training::interface1::Result
Provides methods to access the result obtained with the compute() method of model-based training...
Definition: logistic_regression_training_types.h:92
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::logistic_regression::training::interface2::Parameter::penaltyL2
float penaltyL2
Definition: logistic_regression_training_types.h:169
daal::algorithms::logistic_regression::training::interface1::Parameter::interceptFlag
bool interceptFlag
Definition: logistic_regression_training_types.h:80
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::classifier::training::ResultId
ResultId
Definition: classifier_training_types.h:82
daal::algorithms::logistic_regression::training::interface3::Parameter::penaltyL2
float penaltyL2
Definition: logistic_regression_training_types.h:255
daal::algorithms::logistic_regression::training::Method
Method
Computation methods for logistic regression model-based training.
Definition: logistic_regression_training_types.h:53
daal::algorithms::logistic_regression::training::interface1::Parameter
logistic regression algorithm parameters
Definition: logistic_regression_training_types.h:70
daal::algorithms::logistic_regression::training::interface3::Parameter
logistic regression algorithm parameters
Definition: logistic_regression_training_types.h:243

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