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

apriori_types.h
1 /* file: apriori_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 // Association rules parameter structure
21 //--
22 */
23 
24 #ifndef __APRIORI_TYPES_H__
25 #define __APRIORI_TYPES_H__
26 
27 #include "services/daal_defines.h"
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/homogen_numeric_table.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
44 namespace association_rules
45 {
50 enum Method
51 {
52  apriori = 0,
53  defaultDense = 0
54 };
55 
60 enum ItemsetsOrder
61 {
62  itemsetsUnsorted,
63  itemsetsSortedBySupport
64 };
65 
70 enum RulesOrder
71 {
72  rulesUnsorted,
73  rulesSortedByConfidence
74 };
75 
76 
81 enum InputId
82 {
83  data,
84  lastInputId = data
85 };
86 
91 enum ResultId
92 {
93  largeItemsets,
94  largeItemsetsSupport,
95  antecedentItemsets,
96  consequentItemsets,
97  confidence,
98  lastResultId = confidence
99 };
100 
104 namespace interface1
105 {
112 /* [Parameter source code] */
113 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
114 {
115  Parameter(double minSupport = 0.01, double minConfidence = 0.6, size_t nUniqueItems = 0, size_t nTransactions = 0,
116  bool discoverRules = true, ItemsetsOrder itemsetsOrder = itemsetsUnsorted,
117  RulesOrder rulesOrder = rulesUnsorted, size_t minSize = 0, size_t maxSize = 0);
118 
119  double minSupport;
120  double minConfidence;
121  size_t nUniqueItems;
122  size_t nTransactions;
123  bool discoverRules;
124  ItemsetsOrder itemsetsOrder;
125  RulesOrder rulesOrder;
126  size_t minItemsetSize;
127  size_t maxItemsetSize;
133  services::Status check() const DAAL_C11_OVERRIDE;
134 };
135 /* [Parameter source code] */
136 
141 class DAAL_EXPORT Input : public daal::algorithms::Input
142 {
143 public:
144  Input();
145  Input(const Input& other) : daal::algorithms::Input(other){}
146 
147  virtual ~Input() {}
148 
154  data_management::NumericTablePtr get(InputId id) const;
155 
161  void set(InputId id, const data_management::NumericTablePtr &ptr);
162 
168  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
169 };
170 
175 class DAAL_EXPORT Result : public daal::algorithms::Result
176 {
177 public:
178  DECLARE_SERIALIZABLE_CAST(Result);
179  Result();
180  virtual ~Result() {};
181 
188  template <typename algorithmFPType>
189  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
190 
196  data_management::NumericTablePtr get(ResultId id) const;
197 
203  void set(ResultId id, const data_management::NumericTablePtr &ptr);
204 
211  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
212 
213 protected:
214 
215  template<typename Archive, bool onDeserialize>
216  services::Status serialImpl(Archive *arch)
217  {
218  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
219  }
220 };
221 typedef services::SharedPtr<Result> ResultPtr;
223 } // namespace interface1
224 using interface1::Parameter;
225 using interface1::Input;
226 using interface1::Result;
227 using interface1::ResultPtr;
228 
229 } // namespace association_rules
230 } // namespace algorithm
231 } // namespace daal
232 #endif
daal::algorithms::association_rules::rulesSortedByConfidence
Definition: apriori_types.h:73
daal::algorithms::association_rules::itemsetsSortedBySupport
Definition: apriori_types.h:63
daal::algorithms::association_rules::interface1::Parameter::rulesOrder
RulesOrder rulesOrder
Definition: apriori_types.h:125
daal::algorithms::association_rules::interface1::Parameter::maxItemsetSize
size_t maxItemsetSize
Definition: apriori_types.h:127
daal::algorithms::association_rules::interface1::Parameter::nUniqueItems
size_t nUniqueItems
Definition: apriori_types.h:121
daal::algorithms::association_rules::data
Definition: apriori_types.h:83
daal::algorithms::association_rules::largeItemsets
Definition: apriori_types.h:93
daal::algorithms::association_rules::interface1::Parameter
Parameters for the association rules compute() method.
Definition: apriori_types.h:113
daal::algorithms::association_rules::interface1::Parameter::discoverRules
bool discoverRules
Definition: apriori_types.h:123
daal::algorithms::association_rules::confidence
Definition: apriori_types.h:97
daal::algorithms::association_rules::defaultDense
Definition: apriori_types.h:53
daal::algorithms::association_rules::Method
Method
Definition: apriori_types.h:50
daal_defines.h
daal::algorithms::association_rules::interface1::Parameter::minItemsetSize
size_t minItemsetSize
Definition: apriori_types.h:126
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:175
daal::algorithms::association_rules::interface1::Input
Input for the association rules algorithm
Definition: apriori_types.h:141
daal::algorithms::association_rules::interface1::Parameter::minSupport
double minSupport
Definition: apriori_types.h:119
daal::algorithms::association_rules::InputId
InputId
Definition: apriori_types.h:81
daal::algorithms::association_rules::RulesOrder
RulesOrder
Definition: apriori_types.h:70
daal::algorithms::association_rules::itemsetsUnsorted
Definition: apriori_types.h:62
daal::algorithms::association_rules::apriori
Definition: apriori_types.h:52
daal::algorithms::association_rules::ResultId
ResultId
Definition: apriori_types.h:91
daal::algorithms::association_rules::ItemsetsOrder
ItemsetsOrder
Definition: apriori_types.h:60
daal::algorithms::association_rules::interface1::Parameter::nTransactions
size_t nTransactions
Definition: apriori_types.h:122
daal::algorithms::association_rules::consequentItemsets
Definition: apriori_types.h:96
daal::algorithms::association_rules::antecedentItemsets
Definition: apriori_types.h:95
daal::algorithms::association_rules::interface1::Parameter::minConfidence
double minConfidence
Definition: apriori_types.h:120
daal::algorithms::association_rules::largeItemsetsSupport
Definition: apriori_types.h:94
daal::algorithms::association_rules::interface1::Parameter::itemsetsOrder
ItemsetsOrder itemsetsOrder
Definition: apriori_types.h:124
daal::algorithms::association_rules::rulesUnsorted
Definition: apriori_types.h:72

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