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

apriori_types.h
1 /* file: apriori_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 // Association rules parameter structure
19 //--
20 */
21 
22 #ifndef __APRIORI_TYPES_H__
23 #define __APRIORI_TYPES_H__
24 
25 #include "services/daal_defines.h"
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
42 namespace association_rules
43 {
48 enum Method
49 {
50  apriori = 0,
51  defaultDense = 0
52 };
53 
58 enum ItemsetsOrder
59 {
60  itemsetsUnsorted,
61  itemsetsSortedBySupport
62 };
63 
68 enum RulesOrder
69 {
70  rulesUnsorted,
71  rulesSortedByConfidence
72 };
73 
74 
79 enum InputId
80 {
81  data,
82  lastInputId = data
83 };
84 
89 enum ResultId
90 {
91  largeItemsets,
92  largeItemsetsSupport,
93  antecedentItemsets,
94  consequentItemsets,
95  confidence,
96  lastResultId = confidence
97 };
98 
102 namespace interface1
103 {
110 /* [Parameter source code] */
111 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
112 {
113  Parameter(double minSupport = 0.01, double minConfidence = 0.6, size_t nUniqueItems = 0, size_t nTransactions = 0,
114  bool discoverRules = true, ItemsetsOrder itemsetsOrder = itemsetsUnsorted,
115  RulesOrder rulesOrder = rulesUnsorted, size_t minSize = 0, size_t maxSize = 0);
116 
117  double minSupport;
118  double minConfidence;
119  size_t nUniqueItems;
120  size_t nTransactions;
121  bool discoverRules;
122  ItemsetsOrder itemsetsOrder;
123  RulesOrder rulesOrder;
124  size_t minItemsetSize;
125  size_t maxItemsetSize;
131  services::Status check() const DAAL_C11_OVERRIDE;
132 };
133 /* [Parameter source code] */
134 
139 class DAAL_EXPORT Input : public daal::algorithms::Input
140 {
141 public:
142  Input();
143  Input(const Input& other) : daal::algorithms::Input(other){}
144 
145  virtual ~Input() {}
146 
152  data_management::NumericTablePtr get(InputId id) const;
153 
159  void set(InputId id, const data_management::NumericTablePtr &ptr);
160 
166  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
167 };
168 
173 class DAAL_EXPORT Result : public daal::algorithms::Result
174 {
175 public:
176  DECLARE_SERIALIZABLE_CAST(Result);
177  Result();
178  virtual ~Result() {};
179 
186  template <typename algorithmFPType>
187  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
188 
194  data_management::NumericTablePtr get(ResultId id) const;
195 
201  void set(ResultId id, const data_management::NumericTablePtr &ptr);
202 
209  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
210 
211 protected:
212 
213  template<typename Archive, bool onDeserialize>
214  services::Status serialImpl(Archive *arch)
215  {
216  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
217  }
218 };
219 typedef services::SharedPtr<Result> ResultPtr;
221 } // namespace interface1
222 using interface1::Parameter;
223 using interface1::Input;
224 using interface1::Result;
225 using interface1::ResultPtr;
226 
227 } // namespace association_rules
228 } // namespace algorithm
229 } // namespace daal
230 #endif
daal::algorithms::association_rules::interface1::Parameter::nUniqueItems
size_t nUniqueItems
Definition: apriori_types.h:119
daal
Definition: algorithm_base_common.h:31
daal::algorithms::association_rules::confidence
Definition: apriori_types.h:95
daal::algorithms::association_rules::defaultDense
Definition: apriori_types.h:51
daal::algorithms::association_rules::interface1::Parameter::minConfidence
double minConfidence
Definition: apriori_types.h:118
daal::algorithms::association_rules::apriori
Definition: apriori_types.h:50
daal::algorithms::association_rules::Method
Method
Definition: apriori_types.h:48
daal::algorithms::association_rules::largeItemsetsSupport
Definition: apriori_types.h:92
daal::algorithms::association_rules::interface1::Parameter::nTransactions
size_t nTransactions
Definition: apriori_types.h:120
daal::algorithms::association_rules::interface1::Parameter::rulesOrder
RulesOrder rulesOrder
Definition: apriori_types.h:123
daal::algorithms::association_rules::interface1::Parameter::itemsetsOrder
ItemsetsOrder itemsetsOrder
Definition: apriori_types.h:122
daal_defines.h
daal::algorithms::association_rules::itemsetsSortedBySupport
Definition: apriori_types.h:61
daal::algorithms::association_rules::antecedentItemsets
Definition: apriori_types.h:93
daal::algorithms::association_rules::data
Definition: apriori_types.h:81
daal::algorithms::association_rules::ResultId
ResultId
Definition: apriori_types.h:89
daal::algorithms::association_rules::itemsetsUnsorted
Definition: apriori_types.h:60
daal::algorithms::association_rules::interface1::Parameter::maxItemsetSize
size_t maxItemsetSize
Definition: apriori_types.h:125
daal::algorithms::association_rules::interface1::Parameter::minItemsetSize
size_t minItemsetSize
Definition: apriori_types.h:124
daal::algorithms::association_rules::rulesSortedByConfidence
Definition: apriori_types.h:71
daal::algorithms::association_rules::consequentItemsets
Definition: apriori_types.h:94
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:173
daal::algorithms::association_rules::ItemsetsOrder
ItemsetsOrder
Definition: apriori_types.h:58
daal::algorithms::association_rules::interface1::Parameter::minSupport
double minSupport
Definition: apriori_types.h:117
daal::algorithms::association_rules::interface1::Parameter::discoverRules
bool discoverRules
Definition: apriori_types.h:121
daal::algorithms::association_rules::largeItemsets
Definition: apriori_types.h:91
daal::algorithms::association_rules::rulesUnsorted
Definition: apriori_types.h:70
daal::algorithms::association_rules::interface1::Input
Input for the association rules algorithm
Definition: apriori_types.h:139
daal::algorithms::association_rules::interface1::Parameter
Parameters for the association rules compute() method.
Definition: apriori_types.h:111
daal::algorithms::association_rules::InputId
InputId
Definition: apriori_types.h:79
daal::algorithms::association_rules::RulesOrder
RulesOrder
Definition: apriori_types.h:68

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