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

zscore_types.h
1 /* file: zscore_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 // Definition of common types of z-score normalization.
21 //--
22 */
23 
24 #ifndef __ZSCORE_TYPES_H__
25 #define __ZSCORE_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "data_management/data/homogen_numeric_table.h"
30 #include "algorithms/moments/low_order_moments_batch.h"
31 #include "services/daal_defines.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
46 namespace normalization
47 {
57 namespace zscore
58 {
64 enum Method
65 {
66  defaultDense = 0,
67  sumDense = 1,
69 };
70 
76 enum InputId
77 {
78  data,
79  lastInputId = data
80 };
81 
82 
88 enum ResultId
89 {
90  normalizedData,
91  means,
92  variances,
93  lastResultId = variances
94 };
95 
96 
102 enum ResultToComputeId
103 {
104  none = 0x00000000ULL,
105  mean = 0x00000001ULL,
106  variance = 0x00000002ULL
107 };
108 
109 
113 namespace interface1
114 {
115 
120 class DAAL_EXPORT Input : public daal::algorithms::Input
121 {
122 public:
124  Input();
125 
127  Input(const Input& other);
128 
129  virtual ~Input() {}
130 
136  data_management::NumericTablePtr get(InputId id) const;
137 
143  void set(InputId id, const data_management::NumericTablePtr &ptr);
144 
152  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
153 };
154 
157 } // namespace interface1
158 
159 
163 namespace interface2
164 {
165 
171 class DAAL_EXPORT Result : public daal::algorithms::Result
172 {
173 public:
174  DECLARE_SERIALIZABLE_CAST(Result);
175  Result(const Result& o);
176  Result();
177 
178  virtual ~Result() {};
179 
188  template <typename algorithmFPType>
189  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
190 
191 
199  template <typename algorithmFPType>
200  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const int method);
201 
202 
203 
209  data_management::NumericTablePtr get(ResultId id) const;
210 
216  void set(ResultId id, const data_management::NumericTablePtr &value);
217 
226  services::Status check(const daal::algorithms::Input *in, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
227 
228 protected:
230  template<typename Archive, bool onDeserialize>
231  services::Status serialImpl(Archive *arch)
232  {
233  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
234  }
235 };
236 typedef services::SharedPtr<Result> ResultPtr;
237 
240 } // namespace interface2
241 
242 
246 namespace interface3
247 {
248 
253 template<typename algorithmFPType, Method method>
254 class DAAL_EXPORT Parameter {};
255 
260 class DAAL_EXPORT BaseParameter : public daal::algorithms::Parameter
261 {
262 public:
263  BaseParameter(const bool doScale = true);
264  DAAL_UINT64 resultsToCompute;
265  bool doScale;
266 };
267 
268 // /**
269 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
270 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
271 // */
272 template<typename algorithmFPType>
273 class DAAL_EXPORT Parameter<algorithmFPType, sumDense> : public BaseParameter
274 {
275 public:
276  Parameter(const bool doScale = true);
277 };
278 
279 // /**
280 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
281 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
282 // */
283 template<typename algorithmFPType>
284 class DAAL_EXPORT Parameter<algorithmFPType, defaultDense> : public BaseParameter
285 {
286 public:
288  Parameter(const services::SharedPtr<low_order_moments::BatchImpl> &momentsForParameter =
289  services::SharedPtr<low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense> >
290  (new low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense>()), const bool doScale = true);
291 
292  services::SharedPtr<low_order_moments::BatchImpl> moments;
299  virtual services::Status check() const DAAL_C11_OVERRIDE;
300 };
301 }// namespace interface3
302 
303 using interface1::Input;
304 using interface3::Parameter;
305 using interface3::BaseParameter;
306 using interface2::Result;
307 using interface2::ResultPtr;
308 
309 } // namespace zscore
310 } // namespace normalization
311 } // namespace algorithms
312 } // namespace daal
313 #endif
daal::algorithms::normalization::zscore::mean
Definition: zscore_types.h:105
daal::algorithms::normalization::zscore::interface3::Parameter
Class that specifies the parameters of the algorithm in the batch computing mode. ...
Definition: zscore_types.h:254
daal::algorithms::normalization::zscore::means
Definition: zscore_types.h:91
daal::algorithms::normalization::zscore::InputId
InputId
Definition: zscore_types.h:76
daal::algorithms::normalization::zscore::interface3::BaseParameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: zscore_types.h:264
daal::algorithms::normalization::zscore::interface3::Parameter< algorithmFPType, defaultDense >::moments
services::SharedPtr< low_order_moments::BatchImpl > moments
Definition: zscore_types.h:292
daal::algorithms::normalization::zscore::interface3::BaseParameter
Class that specifies the base parameters of the algorithm in the batch computing mode.
Definition: zscore_types.h:260
daal::algorithms::normalization::zscore::data
Definition: zscore_types.h:78
daal::algorithms::normalization::zscore::variance
Definition: zscore_types.h:106
daal::algorithms::normalization::zscore::normalizedData
Definition: zscore_types.h:90
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:171
daal::algorithms::normalization::zscore::interface3::BaseParameter::doScale
bool doScale
Definition: zscore_types.h:265
daal::algorithms::normalization::zscore::defaultDense
Definition: zscore_types.h:66
daal::algorithms::normalization::zscore::Method
Method
Definition: zscore_types.h:64
daal_defines.h
daal::algorithms::normalization::zscore::sumDense
Definition: zscore_types.h:67
daal::algorithms::normalization::zscore::ResultId
ResultId
Definition: zscore_types.h:88
daal::algorithms::normalization::zscore::variances
Definition: zscore_types.h:92
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::normalization::zscore::interface1::Input
Input objects for the z-score normalization algorithm
Definition: zscore_types.h:120
daal::algorithms::normalization::zscore::ResultToComputeId
ResultToComputeId
Definition: zscore_types.h:102

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