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

classifier_predict_types.h
1 /* file: classifier_predict_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 __CLASSIFIER_PREDICT_TYPES_H__
24 #define __CLASSIFIER_PREDICT_TYPES_H__
25 
26 #include "algorithms/algorithm.h"
27 #include "algorithms/classifier/classifier_model.h"
28 
29 #include "data_management/data/homogen_numeric_table.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace classifier
36 {
46 namespace prediction
47 {
53 enum NumericTableInputId
54 {
55  data,
56  lastNumericTableInputId = data
57 };
58 
64 enum ModelInputId
65 {
66  model = lastNumericTableInputId + 1,
67  lastModelInputId = model
68 };
69 
74 enum ResultId
75 {
76  prediction,
77  lastResultId = prediction
78 };
79 
83 namespace interface1
84 {
89 class DAAL_EXPORT InputIface : public daal::algorithms::Input
90 {
91 public:
92  InputIface(size_t nElements);
93  InputIface(const InputIface& other) : daal::algorithms::Input(other){}
94 
95  virtual ~InputIface() {}
100  virtual size_t getNumberOfRows() const = 0;
101 };
102 
107 class DAAL_EXPORT Input : public InputIface
108 {
109 public:
110  Input();
111  Input(const Input& other) : InputIface(other){}
112  virtual ~Input() {}
113 
118  size_t getNumberOfRows() const DAAL_C11_OVERRIDE;
119 
125  data_management::NumericTablePtr get(NumericTableInputId id) const;
126 
132  classifier::ModelPtr get(ModelInputId id) const;
133 
139  void set(NumericTableInputId id, const data_management::NumericTablePtr &ptr);
140 
146  void set(ModelInputId id, const ModelPtr &ptr);
147 
153  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
154 
155 protected:
156  services::Status checkImpl(const daal::algorithms::Parameter *parameter) const;
157 };
158 
164 class DAAL_EXPORT Result : public daal::algorithms::Result
165 {
166 public:
167  DECLARE_SERIALIZABLE_CAST(Result);
168  Result();
169 
175  data_management::NumericTablePtr get(ResultId id) const;
176 
182  void set(ResultId id, const data_management::NumericTablePtr &value);
183 
191  template <typename algorithmFPType>
192  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
193 
200  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter,
201  int method) const DAAL_C11_OVERRIDE;
202 
203 protected:
204  Result(size_t n);
205  services::Status checkImpl(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter) const;
206 
208  template<typename Archive, bool onDeserialize>
209  services::Status serialImpl(Archive *arch)
210  {
211  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
212  }
213 };
214 typedef services::SharedPtr<Result> ResultPtr;
215 } // namespace interface1
216 using interface1::InputIface;
217 using interface1::Input;
218 using interface1::Result;
219 using interface1::ResultPtr;
220 }
222 }
223 }
224 }
225 #endif
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:164
daal
Definition: algorithm_base_common.h:31
daal::algorithms::classifier::prediction::ModelInputId
ModelInputId
Definition: classifier_predict_types.h:64
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:107
daal::algorithms::classifier::prediction::NumericTableInputId
NumericTableInputId
Definition: classifier_predict_types.h:53
daal::algorithms::classifier::prediction::model
Definition: classifier_predict_types.h:66
daal::algorithms::classifier::prediction::interface1::InputIface
Base class for working with input objects in the prediction stage of the classification algorithm...
Definition: classifier_predict_types.h:89
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::classifier::prediction::data
Definition: classifier_predict_types.h:55

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