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

apriori_types.h
1 /* file: apriori_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Association rules parameter structure
45 //--
46 */
47 
48 #ifndef __APRIORI_TYPES_H__
49 #define __APRIORI_TYPES_H__
50 
51 #include "services/daal_defines.h"
52 #include "algorithms/algorithm.h"
53 #include "data_management/data/homogen_numeric_table.h"
54 
55 namespace daal
56 {
57 namespace algorithms
58 {
68 namespace association_rules
69 {
74 enum Method
75 {
76  apriori = 0,
77  defaultDense = 0
78 };
79 
84 enum ItemsetsOrder
85 {
86  itemsetsUnsorted,
87  itemsetsSortedBySupport
88 };
89 
94 enum RulesOrder
95 {
96  rulesUnsorted,
97  rulesSortedByConfidence
98 };
99 
100 
105 enum InputId
106 {
107  data,
108  lastInputId = data
109 };
110 
115 enum ResultId
116 {
117  largeItemsets,
118  largeItemsetsSupport,
119  antecedentItemsets,
120  consequentItemsets,
121  confidence,
122  lastResultId = confidence
123 };
124 
128 namespace interface1
129 {
136 /* [Parameter source code] */
137 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
138 {
139  Parameter(double minSupport = 0.01, double minConfidence = 0.6, size_t nUniqueItems = 0, size_t nTransactions = 0,
140  bool discoverRules = true, ItemsetsOrder itemsetsOrder = itemsetsUnsorted,
141  RulesOrder rulesOrder = rulesUnsorted, size_t minSize = 0, size_t maxSize = 0);
142 
143  double minSupport;
144  double minConfidence;
145  size_t nUniqueItems;
146  size_t nTransactions;
147  bool discoverRules;
148  ItemsetsOrder itemsetsOrder;
149  RulesOrder rulesOrder;
150  size_t minItemsetSize;
151  size_t maxItemsetSize;
157  services::Status check() const DAAL_C11_OVERRIDE;
158 };
159 /* [Parameter source code] */
160 
165 class DAAL_EXPORT Input : public daal::algorithms::Input
166 {
167 public:
168  Input();
169  Input(const Input& other) : daal::algorithms::Input(other){}
170 
171  virtual ~Input() {}
172 
178  data_management::NumericTablePtr get(InputId id) const;
179 
185  void set(InputId id, const data_management::NumericTablePtr &ptr);
186 
192  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
193 };
194 
199 class DAAL_EXPORT Result : public daal::algorithms::Result
200 {
201 public:
202  DECLARE_SERIALIZABLE_CAST(Result);
203  Result();
204  virtual ~Result() {};
205 
212  template <typename algorithmFPType>
213  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
214 
220  data_management::NumericTablePtr get(ResultId id) const;
221 
227  void set(ResultId id, const data_management::NumericTablePtr &ptr);
228 
235  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
236 
237 protected:
238 
239  template<typename Archive, bool onDeserialize>
240  services::Status serialImpl(Archive *arch)
241  {
242  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
243  }
244 };
245 typedef services::SharedPtr<Result> ResultPtr;
247 } // namespace interface1
248 using interface1::Parameter;
249 using interface1::Input;
250 using interface1::Result;
251 using interface1::ResultPtr;
252 
253 } // namespace association_rules
254 } // namespace algorithm
255 } // namespace daal
256 #endif
daal::algorithms::association_rules::interface1::Parameter::nUniqueItems
size_t nUniqueItems
Definition: apriori_types.h:145
daal
Definition: algorithm_base_common.h:57
daal::algorithms::association_rules::confidence
Definition: apriori_types.h:121
daal::algorithms::association_rules::defaultDense
Definition: apriori_types.h:77
daal::algorithms::association_rules::interface1::Parameter::minConfidence
double minConfidence
Definition: apriori_types.h:144
daal::algorithms::association_rules::apriori
Definition: apriori_types.h:76
daal::algorithms::association_rules::Method
Method
Definition: apriori_types.h:74
daal::algorithms::association_rules::largeItemsetsSupport
Definition: apriori_types.h:118
daal::algorithms::association_rules::interface1::Parameter::nTransactions
size_t nTransactions
Definition: apriori_types.h:146
daal::algorithms::association_rules::interface1::Parameter::rulesOrder
RulesOrder rulesOrder
Definition: apriori_types.h:149
daal::algorithms::association_rules::interface1::Parameter::itemsetsOrder
ItemsetsOrder itemsetsOrder
Definition: apriori_types.h:148
daal_defines.h
daal::algorithms::association_rules::itemsetsSortedBySupport
Definition: apriori_types.h:87
daal::algorithms::association_rules::antecedentItemsets
Definition: apriori_types.h:119
daal::algorithms::association_rules::data
Definition: apriori_types.h:107
daal::algorithms::association_rules::ResultId
ResultId
Definition: apriori_types.h:115
daal::algorithms::association_rules::itemsetsUnsorted
Definition: apriori_types.h:86
daal::algorithms::association_rules::interface1::Parameter::maxItemsetSize
size_t maxItemsetSize
Definition: apriori_types.h:151
daal::algorithms::association_rules::interface1::Parameter::minItemsetSize
size_t minItemsetSize
Definition: apriori_types.h:150
daal::algorithms::association_rules::rulesSortedByConfidence
Definition: apriori_types.h:97
daal::algorithms::association_rules::consequentItemsets
Definition: apriori_types.h:120
daal::algorithms::association_rules::interface1::Result
Results obtained with the compute() method of the association rules algorithm in the batch processing...
Definition: apriori_types.h:199
daal::algorithms::association_rules::ItemsetsOrder
ItemsetsOrder
Definition: apriori_types.h:84
daal::algorithms::association_rules::interface1::Parameter::minSupport
double minSupport
Definition: apriori_types.h:143
daal::algorithms::association_rules::interface1::Parameter::discoverRules
bool discoverRules
Definition: apriori_types.h:147
daal::algorithms::association_rules::largeItemsets
Definition: apriori_types.h:117
daal::algorithms::association_rules::rulesUnsorted
Definition: apriori_types.h:96
daal::algorithms::association_rules::interface1::Input
Input for the association rules algorithm
Definition: apriori_types.h:165
daal::algorithms::association_rules::interface1::Parameter
Parameters for the association rules compute() method.
Definition: apriori_types.h:137
daal::algorithms::association_rules::InputId
InputId
Definition: apriori_types.h:105
daal::algorithms::association_rules::RulesOrder
RulesOrder
Definition: apriori_types.h:94

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