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

zscore_types.h
1 /* file: zscore_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 // Definition of common types of z-score normalization.
19 //--
20 */
21 
22 #ifndef __ZSCORE_TYPES_H__
23 #define __ZSCORE_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 #include "algorithms/moments/low_order_moments_batch.h"
29 #include "services/daal_defines.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
44 namespace normalization
45 {
55 namespace zscore
56 {
62 enum Method
63 {
64  defaultDense = 0,
65  sumDense = 1,
67 };
68 
74 enum InputId
75 {
76  data,
77  lastInputId = data
78 };
79 
80 
86 enum ResultId
87 {
88  normalizedData,
89  means,
90  variances,
91  lastResultId = variances
92 };
93 
94 
100 enum ResultToComputeId
101 {
102  none = 0x00000000ULL,
103  mean = 0x00000001ULL,
104  variance = 0x00000002ULL
105 };
106 
107 
111 namespace interface1
112 {
113 
118 class DAAL_EXPORT Input : public daal::algorithms::Input
119 {
120 public:
122  Input();
123 
125  Input(const Input& other);
126 
127  virtual ~Input() {}
128 
134  data_management::NumericTablePtr get(InputId id) const;
135 
141  void set(InputId id, const data_management::NumericTablePtr &ptr);
142 
150  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
151 };
152 
155 } // namespace interface1
156 
157 
161 namespace interface2
162 {
163 
169 class DAAL_EXPORT Result : public daal::algorithms::Result
170 {
171 public:
172  DECLARE_SERIALIZABLE_CAST(Result);
173  Result(const Result& o);
174  Result();
175 
176  virtual ~Result() {};
177 
186  template <typename algorithmFPType>
187  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
188 
189 
197  template <typename algorithmFPType>
198  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const int method);
199 
200 
201 
207  data_management::NumericTablePtr get(ResultId id) const;
208 
214  void set(ResultId id, const data_management::NumericTablePtr &value);
215 
224  services::Status check(const daal::algorithms::Input *in, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
225 
226 protected:
228  template<typename Archive, bool onDeserialize>
229  services::Status serialImpl(Archive *arch)
230  {
231  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
232  }
233 };
234 typedef services::SharedPtr<Result> ResultPtr;
235 
238 } // namespace interface2
239 
240 
244 namespace interface3
245 {
246 
251 template<typename algorithmFPType, Method method>
252 class DAAL_EXPORT Parameter {};
253 
258 class DAAL_EXPORT BaseParameter : public daal::algorithms::Parameter
259 {
260 public:
261  BaseParameter(const bool doScale = true);
262  DAAL_UINT64 resultsToCompute;
263  bool doScale;
264 };
265 
266 // /**
267 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
268 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
269 // */
270 template<typename algorithmFPType>
271 class DAAL_EXPORT Parameter<algorithmFPType, sumDense> : public BaseParameter
272 {
273 public:
274  Parameter(const bool doScale = true);
275 };
276 
277 // /**
278 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
279 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
280 // */
281 template<typename algorithmFPType>
282 class DAAL_EXPORT Parameter<algorithmFPType, defaultDense> : public BaseParameter
283 {
284 public:
286  Parameter(const services::SharedPtr<low_order_moments::BatchImpl> &momentsForParameter =
287  services::SharedPtr<low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense> >
288  (new low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense>()), const bool doScale = true);
289 
290  services::SharedPtr<low_order_moments::BatchImpl> moments;
297  virtual services::Status check() const DAAL_C11_OVERRIDE;
298 };
299 }// namespace interface3
300 
301 using interface1::Input;
302 using interface3::Parameter;
303 using interface3::BaseParameter;
304 using interface2::Result;
305 using interface2::ResultPtr;
306 
307 } // namespace zscore
308 } // namespace normalization
309 } // namespace algorithms
310 } // namespace daal
311 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::normalization::zscore::interface1::Input
Input objects for the z-score normalization algorithm
Definition: zscore_types.h:118
daal::algorithms::normalization::zscore::interface3::Parameter< algorithmFPType, defaultDense >::moments
services::SharedPtr< low_order_moments::BatchImpl > moments
Definition: zscore_types.h:290
daal::algorithms::normalization::zscore::defaultDense
Definition: zscore_types.h:64
daal::algorithms::normalization::zscore::Method
Method
Definition: zscore_types.h:62
daal::algorithms::normalization::zscore::sumDense
Definition: zscore_types.h:65
daal::algorithms::normalization::zscore::variances
Definition: zscore_types.h:90
daal_defines.h
daal::algorithms::normalization::zscore::data
Definition: zscore_types.h:76
daal::algorithms::normalization::zscore::variance
Definition: zscore_types.h:104
daal::algorithms::normalization::zscore::InputId
InputId
Definition: zscore_types.h:74
daal::algorithms::normalization::zscore::interface2::Result
Provides methods to access final results obtained with the compute() method of the z-score normalizat...
Definition: zscore_types.h:169
daal::algorithms::normalization::zscore::means
Definition: zscore_types.h:89
daal::algorithms::normalization::zscore::ResultToComputeId
ResultToComputeId
Definition: zscore_types.h:100
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::normalization::zscore::interface3::Parameter
Class that specifies the parameters of the algorithm in the batch computing mode. ...
Definition: zscore_types.h:252
daal::algorithms::normalization::zscore::interface3::BaseParameter
Class that specifies the base parameters of the algorithm in the batch computing mode.
Definition: zscore_types.h:258
daal::algorithms::normalization::zscore::ResultId
ResultId
Definition: zscore_types.h:86
daal::algorithms::normalization::zscore::mean
Definition: zscore_types.h:103
daal::algorithms::normalization::zscore::interface3::BaseParameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: zscore_types.h:262
daal::algorithms::normalization::zscore::normalizedData
Definition: zscore_types.h:88
daal::algorithms::normalization::zscore::interface3::BaseParameter::doScale
bool doScale
Definition: zscore_types.h:263

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