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

logistic_regression_predict_types.h
1 /* file: logistic_regression_predict_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 base classes used in the prediction stage
19 // of the classifier algorithm
20 //--
21 */
22 
23 #ifndef __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
24 #define __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
25 
26 #include "algorithms/algorithm.h"
27 #include "algorithms/logistic_regression/logistic_regression_model.h"
28 #include "algorithms/classifier/classifier_predict_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace logistic_regression
35 {
44 namespace prediction
45 {
46 
51 enum Method
52 {
53  defaultDense = 0
54 };
55 
60 enum ResultToComputeId
61 {
62  computeClassesLabels = 0x00000001ULL,
63  computeClassesProbabilities = 0x00000002ULL,
64  computeClassesLogProbabilities = 0x00000004ULL
65 };
66 
71 enum ResultNumericTableId
72 {
73  probabilities = classifier::prediction::lastResultId + 1,
77  logProbabilities,
81  lastResultNumericTableId = logProbabilities
82 };
83 
87 namespace interface1
88 {
89 
96 /* [Parameter source code] */
97 struct DAAL_EXPORT Parameter : public daal::algorithms::classifier::Parameter
98 {
99  Parameter(size_t nClasses = 2) : daal::algorithms::classifier::Parameter(nClasses), resultsToCompute(computeClassesLabels) {}
100  Parameter(const Parameter& o) : daal::algorithms::classifier::Parameter(o), resultsToCompute(o.resultsToCompute){}
101  DAAL_UINT64 resultsToCompute;
102 };
103 /* [Parameter source code] */
104 
109 class DAAL_EXPORT Input : public classifier::prediction::Input
110 {
111  typedef classifier::prediction::Input super;
112 public:
113  Input() : super(){}
114  Input(const Input& other) : super(other){}
115  virtual ~Input() {}
116 
117  using super::get;
118  using super::set;
119 
125  data_management::NumericTablePtr get(classifier::prediction::NumericTableInputId id) const;
126 
132  logistic_regression::ModelPtr get(classifier::prediction::ModelInputId id) const;
133 
139  void set(classifier::prediction::NumericTableInputId id, const data_management::NumericTablePtr &ptr);
140 
146  void set(classifier::prediction::ModelInputId id, const logistic_regression::ModelPtr &ptr);
147 
154  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
155 };
156 
161 class DAAL_EXPORT Result : public algorithms::classifier::prediction::Result
162 {
163 public:
164  DECLARE_SERIALIZABLE_CAST(Result)
165  Result();
166 
172  data_management::NumericTablePtr get(classifier::prediction::ResultId id) const;
173 
179  void set(classifier::prediction::ResultId id, const data_management::NumericTablePtr &value);
180 
186  data_management::NumericTablePtr get(ResultNumericTableId id) const;
187 
193  void set(ResultNumericTableId id, const data_management::NumericTablePtr &value);
194 
202  template <typename algorithmFPType>
203  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
204 
212  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
213 
214 protected:
216  template<typename Archive, bool onDeserialize>
217  services::Status serialImpl(Archive *arch)
218  {
219  return daal::algorithms::classifier::prediction::Result::serialImpl<Archive, onDeserialize>(arch);
220  }
221 };
222 typedef services::SharedPtr<Result> ResultPtr;
223 typedef services::SharedPtr<const Result> ResultConstPtr;
224 
225 } // namespace interface1
226 using interface1::Parameter;
227 using interface1::Input;
228 using interface1::Result;
229 using interface1::ResultPtr;
230 using interface1::ResultConstPtr;
231 }
233 }
234 }
235 }
236 #endif // __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
daal::algorithms::logistic_regression::prediction::logProbabilities
Definition: logistic_regression_predict_types.h:77
daal
Definition: algorithm_base_common.h:31
daal::algorithms::classifier::prediction::ModelInputId
ModelInputId
Definition: classifier_predict_types.h:64
daal::algorithms::logistic_regression::prediction::interface1::Input
Input objects in the prediction stage of the LOGISTIC_REGRESSION algorithm.
Definition: logistic_regression_predict_types.h:109
daal::algorithms::classifier::prediction::NumericTableInputId
NumericTableInputId
Definition: classifier_predict_types.h:53
daal::algorithms::logistic_regression::prediction::defaultDense
Definition: logistic_regression_predict_types.h:53
daal::algorithms::logistic_regression::prediction::interface1::Result
Provides interface for the result of model-based prediction.
Definition: logistic_regression_predict_types.h:161
daal::algorithms::logistic_regression::prediction::probabilities
Definition: logistic_regression_predict_types.h:73
daal::algorithms::logistic_regression::prediction::ResultToComputeId
ResultToComputeId
Definition: logistic_regression_predict_types.h:60
daal::algorithms::logistic_regression::prediction::Method
Method
Definition: logistic_regression_predict_types.h:51
daal::algorithms::logistic_regression::prediction::ResultNumericTableId
ResultNumericTableId
Definition: logistic_regression_predict_types.h:71
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::classifier::prediction::ResultId
ResultId
Definition: classifier_predict_types.h:74
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::logistic_regression::prediction::interface1::Parameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: logistic_regression_predict_types.h:101
daal::algorithms::logistic_regression::prediction::interface1::Parameter
Parameters of the prediction algorithm.
Definition: logistic_regression_predict_types.h:97

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