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

logistic_regression_predict_types.h
1 /* file: logistic_regression_predict_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 base classes used in the prediction stage
21 // of the classifier algorithm
22 //--
23 */
24 
25 #ifndef __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
26 #define __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
27 
28 #include "algorithms/algorithm.h"
29 #include "algorithms/logistic_regression/logistic_regression_model.h"
30 #include "algorithms/classifier/classifier_predict_types.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace logistic_regression
37 {
46 namespace prediction
47 {
48 
53 enum Method
54 {
55  defaultDense = 0
56 };
57 
62 enum ResultToComputeId
63 {
64  computeClassesLabels = classifier::computeClassLabels,
65  computeClassesProbabilities = classifier::computeClassProbabilities,
66  computeClassesLogProbabilities = classifier::computeClassLogProbabilities
67 };
68 
73 enum ResultNumericTableId
74 {
75  probabilities = classifier::prediction::probabilities,
79  logProbabilities = classifier::prediction::logProbabilities,
83  lastResultNumericTableId = logProbabilities
84 };
85 
89 namespace interface1
90 {
91 
98 /* [Parameter source code] */
99 struct DAAL_EXPORT Parameter : public daal::algorithms::classifier::interface1::Parameter
100 {
101  DAAL_DEPRECATED Parameter(size_t nClasses = 2) : daal::algorithms::classifier::interface1::Parameter(nClasses), resultsToCompute(computeClassesLabels) {}
102  DAAL_DEPRECATED Parameter(const Parameter& o) : daal::algorithms::classifier::interface1::Parameter(o), resultsToCompute(o.resultsToCompute){}
103  DAAL_UINT64 resultsToCompute;
104 };
105 /* [Parameter source code] */
106 
111 class DAAL_EXPORT Input : public classifier::prediction::Input
112 {
113  typedef classifier::prediction::Input super;
114 public:
115  Input() : super(){}
116  Input(const Input& other) : super(other){}
117  virtual ~Input() {}
118 
119  using super::get;
120  using super::set;
121 
127  data_management::NumericTablePtr get(classifier::prediction::NumericTableInputId id) const;
128 
134  logistic_regression::ModelPtr get(classifier::prediction::ModelInputId id) const;
135 
141  void set(classifier::prediction::NumericTableInputId id, const data_management::NumericTablePtr &ptr);
142 
148  void set(classifier::prediction::ModelInputId id, const logistic_regression::ModelPtr &ptr);
149 
156  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
157 };
158 
163 class DAAL_EXPORT Result : public algorithms::classifier::prediction::interface1::Result
164 {
165 public:
166  DECLARE_SERIALIZABLE_CAST(Result)
167  DAAL_DEPRECATED Result();
168 
174  DAAL_DEPRECATED data_management::NumericTablePtr get(classifier::prediction::ResultId id) const;
175 
181  DAAL_DEPRECATED void set(classifier::prediction::ResultId id, const data_management::NumericTablePtr &value);
182 
188  DAAL_DEPRECATED data_management::NumericTablePtr get(ResultNumericTableId id) const;
189 
195  DAAL_DEPRECATED void set(ResultNumericTableId id, const data_management::NumericTablePtr &value);
196 
204  template <typename algorithmFPType>
205  DAAL_EXPORT DAAL_DEPRECATED services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
206 
214  DAAL_DEPRECATED services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
215 
216 protected:
218  template<typename Archive, bool onDeserialize>
219  services::Status serialImpl(Archive *arch)
220  {
221  return daal::algorithms::classifier::prediction::interface1::Result::serialImpl<Archive, onDeserialize>(arch);
222  }
223 };
224 typedef services::SharedPtr<Result> ResultPtr;
225 typedef services::SharedPtr<const Result> ResultConstPtr;
226 
227 } // namespace interface1
228 using interface1::Input;
229 using classifier::Parameter; /* Support of static backward compatibility */
230 using classifier::prediction::Result; /* Support of static backward compatibility */
231 using classifier::prediction::ResultPtr; /* Support of static backward compatibility */
232 }
234 }
235 }
236 }
237 #endif // __LOGISTIC_REGRESSION_PREDICT_TYPES_H__
daal::algorithms::logistic_regression::prediction::probabilities
Definition: logistic_regression_predict_types.h:75
daal::algorithms::classifier::prediction::logProbabilities
Definition: classifier_predict_types.h:80
daal::algorithms::logistic_regression::prediction::interface1::Parameter
Parameters of the prediction algorithm.
Definition: logistic_regression_predict_types.h:99
daal::algorithms::logistic_regression::prediction::ResultToComputeId
ResultToComputeId
Definition: logistic_regression_predict_types.h:62
daal::algorithms::logistic_regression::prediction::defaultDense
Definition: logistic_regression_predict_types.h:55
daal::algorithms::logistic_regression::prediction::ResultNumericTableId
ResultNumericTableId
Definition: logistic_regression_predict_types.h:73
daal::algorithms::classifier::prediction::probabilities
Definition: classifier_predict_types.h:79
daal::algorithms::logistic_regression::prediction::interface1::Input
Input objects in the prediction stage of the LOGISTIC_REGRESSION algorithm.
Definition: logistic_regression_predict_types.h:111
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::classifier::computeClassProbabilities
Definition: classifier_model.h:49
daal::algorithms::classifier::computeClassLogProbabilities
Definition: classifier_model.h:50
daal::algorithms::classifier::prediction::NumericTableInputId
NumericTableInputId
Definition: classifier_predict_types.h:55
daal::algorithms::classifier::prediction::ResultId
ResultId
Definition: classifier_predict_types.h:76
daal::algorithms::classifier::prediction::interface1::Result
Provides methods to access prediction results obtained with the compute() method of the classifier pr...
Definition: classifier_predict_types.h:168
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::classifier::prediction::ModelInputId
ModelInputId
Definition: classifier_predict_types.h:66
daal::algorithms::logistic_regression::prediction::interface1::Parameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: logistic_regression_predict_types.h:103
daal::algorithms::logistic_regression::prediction::interface1::Result
Provides interface for the result of model-based prediction.
Definition: logistic_regression_predict_types.h:163
daal::algorithms::logistic_regression::prediction::Method
Method
Definition: logistic_regression_predict_types.h:53
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::logistic_regression::prediction::logProbabilities
Definition: logistic_regression_predict_types.h:79
daal::algorithms::classifier::computeClassLabels
Definition: classifier_model.h:48

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