effspm 0.1.7__cp310-cp310-macosx_10_9_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
effspm/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from ._core import PrefixProjection
2
+
3
+ __all__ = ['PrefixProjection']
effspm/_core.cpp ADDED
@@ -0,0 +1,106 @@
1
+ #include <ctime> // std::clock
2
+ #include <cmath> // std::ceil, std::abs
3
+ #include <algorithm> // std::max
4
+ #include <iostream> // optional echo
5
+ #include <pybind11/pybind11.h>
6
+ #include <pybind11/stl.h>
7
+
8
+ #include "load_inst.hpp"
9
+ #include "freq_miner.hpp"
10
+ #include "utility.hpp"
11
+
12
+ namespace py = pybind11;
13
+
14
+ PYBIND11_MODULE(_core, m) {
15
+ m.doc() = "Efficient Sequential Pattern Mining via Prefix-Projection";
16
+
17
+ m.def("PrefixProjection",
18
+ [](py::object data,
19
+ double minsup,
20
+ unsigned int time_limit_arg,
21
+ bool preproc_arg,
22
+ bool use_dic_arg,
23
+ bool verbose_arg,
24
+ const std::string &out_file_arg)
25
+ {
26
+ // 1) configure C++ globals
27
+ time_limit = time_limit_arg;
28
+ pre_pro = preproc_arg;
29
+ use_dic = use_dic_arg;
30
+ use_list = false;
31
+ b_disp = verbose_arg;
32
+ b_write = !out_file_arg.empty();
33
+ out_file = out_file_arg;
34
+
35
+ // 2) clear collector & start timer
36
+ ClearCollected();
37
+ start_time = std::clock();
38
+
39
+ // 3) load either file or in‐memory sequences
40
+ if (py::isinstance<py::str>(data)) {
41
+ auto path = data.cast<std::string>();
42
+ if (!Load_instance(path, minsup))
43
+ throw std::runtime_error("Failed to load database from " + path);
44
+ }
45
+ else {
46
+ // convert Python List[List[int]] → C++ items
47
+ auto seqs = data.cast<std::vector<std::vector<int>>>();
48
+ items = std::move(seqs);
49
+ N = items.size();
50
+
51
+ // a) compute max item ID → L
52
+ int max_id = 0;
53
+ for (auto &seq : items)
54
+ for (int x : seq)
55
+ max_id = std::max(max_id, std::abs(x));
56
+ L = static_cast<unsigned int>(max_id);
57
+
58
+ // b) support threshold θ
59
+ if (minsup < 1.0)
60
+ theta = static_cast<unsigned long long>(std::ceil(minsup * N));
61
+ else
62
+ theta = static_cast<unsigned long long>(minsup);
63
+
64
+ // c) initialize DFS stack
65
+ DFS.clear();
66
+ DFS.reserve(L);
67
+ for (unsigned int i = 0; i < L; ++i)
68
+ DFS.emplace_back(-static_cast<int>(i) - 1);
69
+
70
+ // d) gather dataset stats: max length M, total entries E
71
+ M = 0;
72
+ E = 0;
73
+ for (auto &seq : items) {
74
+ M = std::max<unsigned int>(M, static_cast<unsigned int>(seq.size()));
75
+ E += seq.size();
76
+ }
77
+
78
+ if (b_disp) {
79
+ std::cout << "\nIn-memory dataset: "
80
+ << N << " sequences, max len " << M
81
+ << ", " << E << " entries, " << L << " items\n";
82
+ }
83
+ }
84
+
85
+ // 4) run the C++ miner
86
+ Freq_miner();
87
+
88
+ // 5) collect patterns & timing
89
+ auto patterns = GetCollected();
90
+ double wall_time = give_time(std::clock() - start_time);
91
+
92
+ // 6) return Python dict
93
+ py::dict out;
94
+ out["patterns"] = patterns;
95
+ out["time"] = wall_time;
96
+ return out;
97
+ },
98
+ py::arg("data"),
99
+ py::arg("minsup") = 0.01,
100
+ py::arg("time_limit") = 10 * 3600,
101
+ py::arg("preproc") = false,
102
+ py::arg("use_dic") = false,
103
+ py::arg("verbose") = false,
104
+ py::arg("out_file") = ""
105
+ );
106
+ }
Binary file
effspm/freq_miner.cpp ADDED
@@ -0,0 +1,143 @@
1
+ #include <iostream>
2
+ #include <time.h>
3
+ #include <fstream>
4
+ #include <cmath>
5
+ #include "freq_miner.hpp"
6
+ #include "utility.hpp"
7
+
8
+
9
+
10
+ // Forward declarations from the original code:
11
+ void Extend_patt(Pattern& _patt);
12
+
13
+ // Globals from original:
14
+ unsigned long long int num_patt = 0;
15
+ Pattern _patt;
16
+
17
+ // Main miner function from original:
18
+ void Freq_miner() {
19
+ vector<int> islist;
20
+ if (use_list) {
21
+ for (int i = 0; i < L; ++i) {
22
+ if (DFS[i].freq >= theta)
23
+ islist.push_back(i);
24
+ }
25
+ for (int i = 0; i < DFS.size(); ++i) {
26
+ DFS[i].ilist = islist;
27
+ DFS[i].slist = islist;
28
+ }
29
+ }
30
+
31
+ while (!DFS.empty() && give_time(clock() - start_time) < time_limit) {
32
+ if (DFS.back().freq >= theta)
33
+ Extend_patt(DFS.back());
34
+ else
35
+ DFS.pop_back();
36
+ }
37
+ }
38
+
39
+ // The recursive extension from original:
40
+ void Extend_patt(Pattern& _pattern) {
41
+ swap(_patt, _pattern);
42
+ DFS.pop_back();
43
+
44
+ vector<bool> slist;
45
+ vector<bool> ilist;
46
+
47
+ if (use_list) {
48
+ slist = vector<bool>(L, 0);
49
+ ilist = vector<bool>(L, 0);
50
+ for (int idx : _patt.slist) slist[idx] = 1;
51
+ for (int idx : _patt.ilist) ilist[idx] = 1;
52
+ }
53
+
54
+ vector<Pattern> pot_patt(L * 2);
55
+
56
+ int last_neg = _patt.seq.size() - 1;
57
+ while (_patt.seq[last_neg] > 0) --last_neg;
58
+
59
+ for (int i = 0; i < _patt.str_pnt.size(); ++i) {
60
+ vector<bool> found(L * 2, 0);
61
+ unsigned int seq = _patt.seq_ID[i];
62
+ unsigned int j = _patt.str_pnt[i] + 1;
63
+ // positive extensions
64
+ while (j < items[seq].size() && items[seq][j] > 0) {
65
+ int cur_itm = items[seq][j];
66
+ if (!use_list || ilist[cur_itm - 1]) {
67
+ pot_patt[cur_itm - 1].seq_ID.push_back(seq);
68
+ pot_patt[cur_itm - 1].str_pnt.push_back(j);
69
+ ++pot_patt[cur_itm - 1].freq;
70
+ found[cur_itm - 1] = 1;
71
+ }
72
+ ++j;
73
+ }
74
+ // negative and cross-itemset extensions...
75
+ int num_itmfnd = 0;
76
+ for (int k = j; k < items[seq].size(); ++k) {
77
+ int cur_itm = abs(items[seq][k]);
78
+ if (items[seq][k] < 0) num_itmfnd = 0;
79
+ if ((!use_list || slist[cur_itm - 1]) && !found[L + cur_itm - 1]) {
80
+ pot_patt[L + cur_itm - 1].seq_ID.push_back(seq);
81
+ pot_patt[L + cur_itm - 1].str_pnt.push_back(k);
82
+ ++pot_patt[L + cur_itm - 1].freq;
83
+ found[L + cur_itm - 1] = 1;
84
+ }
85
+ if (num_itmfnd == _patt.seq.size() - last_neg) {
86
+ if ((!use_list || ilist[cur_itm - 1]) && !found[cur_itm - 1]) {
87
+ pot_patt[cur_itm - 1].seq_ID.push_back(seq);
88
+ pot_patt[cur_itm - 1].str_pnt.push_back(k);
89
+ ++pot_patt[cur_itm - 1].freq;
90
+ found[cur_itm - 1] = 1;
91
+ }
92
+ } else if (cur_itm == abs(_patt.seq[last_neg + num_itmfnd])) {
93
+ ++num_itmfnd;
94
+ }
95
+ }
96
+ }
97
+
98
+ // Now generate new DFS states
99
+ if (use_list) {
100
+ // itemset extensions
101
+ vector<int> slistp, ilistp;
102
+ for (int idx : _patt.ilist)
103
+ if (pot_patt[idx].freq >= theta) ilistp.push_back(idx);
104
+ for (int idx : _patt.slist)
105
+ if (pot_patt[idx + L].freq >= theta) slistp.push_back(idx);
106
+
107
+ for (int idx : ilistp) {
108
+ DFS.emplace_back();
109
+ swap(DFS.back(), pot_patt[idx]);
110
+ DFS.back().seq = _patt.seq;
111
+ DFS.back().seq.push_back(idx + 1);
112
+ DFS.back().slist = slistp;
113
+ DFS.back().ilist = ilistp;
114
+ Out_patt(DFS.back().seq, DFS.back().freq);
115
+ ++num_patt;
116
+ }
117
+ for (int idx : slistp) {
118
+ DFS.emplace_back();
119
+ swap(DFS.back(), pot_patt[idx + L]);
120
+ DFS.back().seq = _patt.seq;
121
+ DFS.back().seq.push_back(-idx - 1);
122
+ DFS.back().slist = slistp;
123
+ DFS.back().ilist = slistp;
124
+ Out_patt(DFS.back().seq, DFS.back().freq);
125
+ ++num_patt;
126
+ }
127
+ } else {
128
+ // no list optimization
129
+ for (int i = 0; i < 2 * L; ++i) {
130
+ if (pot_patt[i].freq >= theta) {
131
+ DFS.emplace_back();
132
+ swap(DFS.back(), pot_patt[i]);
133
+ DFS.back().seq = _patt.seq;
134
+ if (i >= L)
135
+ DFS.back().seq.push_back(-(i - L + 1));
136
+ else
137
+ DFS.back().seq.push_back(i + 1);
138
+ Out_patt(DFS.back().seq, DFS.back().freq);
139
+ ++num_patt;
140
+ }
141
+ }
142
+ }
143
+ }
effspm/freq_miner.hpp ADDED
@@ -0,0 +1,45 @@
1
+ #pragma once
2
+ #include <vector>
3
+ #include "load_inst.hpp"
4
+ #include <cstdlib>
5
+ #include <cmath>
6
+ using namespace std;
7
+ void Freq_miner();
8
+ void Out_patt(std::vector<int>& seq, unsigned int freq);
9
+
10
+
11
+ class Pattern {
12
+ public:
13
+
14
+ vector<int> seq;
15
+ vector<unsigned int> str_pnt;
16
+ vector<unsigned int> seq_ID;
17
+
18
+ vector<int> slist;
19
+ vector<int> ilist;
20
+
21
+ unsigned int freq;
22
+
23
+ Pattern(vector<int>& _seq, int item) {
24
+ seq.reserve(_seq.size());
25
+ for (int i = 0; i < _seq.size(); ++i)
26
+ seq.push_back(_seq[i]);
27
+ seq.push_back(item);
28
+ freq = 0;
29
+ }
30
+
31
+
32
+ Pattern(int item) {
33
+ seq.push_back(item);
34
+ freq = 0;
35
+ }
36
+
37
+ Pattern() {
38
+ freq = 0;
39
+ }
40
+
41
+ };
42
+
43
+ extern vector<Pattern> DFS; //DFS queue of potential patterns to extend
44
+
45
+ extern unsigned long long int num_patt;
effspm/load_inst.cpp ADDED
@@ -0,0 +1,252 @@
1
+ #include<iostream>
2
+ #include <sstream>
3
+ #include <algorithm>
4
+ #include "load_inst.hpp"
5
+ #include "freq_miner.hpp"
6
+ #include "utility.hpp"
7
+ #include <math.h>
8
+
9
+ using namespace std;
10
+
11
+ unsigned int M = 0, L = 0;
12
+ unsigned long long int N = 0, E = 0, theta;
13
+
14
+ vector<vector<int>> items;
15
+ vector<Pattern> DFS;
16
+ vector<int> item_dic;
17
+
18
+ bool Load_items(string& inst);
19
+ void Load_items_pre(string& inst);
20
+ bool Preprocess(string& inst, double thresh);
21
+
22
+ bool Load_instance(string &items_file, double thresh) {
23
+
24
+ clock_t kk = clock();
25
+ if (pre_pro) {
26
+ if(!Preprocess(items_file, thresh))
27
+ return 0;
28
+
29
+ cout << "\nPreprocess done in " << give_time(clock() - kk) << " seconds\n\n";
30
+
31
+ DFS.reserve(L);
32
+ for (int i = 0; i < L; ++i)
33
+ DFS.emplace_back(-i - 1);
34
+
35
+
36
+ kk = clock();
37
+
38
+ Load_items_pre(items_file);
39
+
40
+ N = items.size();
41
+
42
+ }
43
+ else if (!Load_items(items_file))
44
+ return 0;
45
+ else {
46
+ if (thresh < 1)
47
+ theta = ceil(thresh * N);
48
+ else
49
+ theta = thresh;
50
+ }
51
+
52
+ cout << "\nMDD Database built in " << give_time(clock() - kk) << " seconds\n\n";
53
+
54
+ cout << "Found " << N << " sequence, with max line len " << M << ", and " << L << " items, and " << E << " enteries\n";
55
+
56
+
57
+ return 1;
58
+ }
59
+
60
+ bool Preprocess(string &inst, double thresh) {
61
+
62
+ ifstream file(inst);
63
+
64
+ vector<unsigned int> freq(1000000);
65
+ vector<unsigned int> counted(1000000, 0);
66
+
67
+ if (file.good()) {
68
+ string line;
69
+ int ditem;
70
+ while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
71
+ ++N;
72
+ istringstream word(line);
73
+ string itm;
74
+ while (word >> itm) {
75
+ ditem = stoi(itm);
76
+ if (L < abs(ditem))
77
+ L = abs(ditem);
78
+
79
+ if (freq.size() < L) {
80
+ freq.reserve(L);
81
+ counted.reserve(L);
82
+ while (freq.size() < L) {
83
+ freq.push_back(0);
84
+ counted.push_back(0);
85
+ }
86
+ }
87
+
88
+ if (counted[abs(ditem) - 1] != N) {
89
+ ++freq[abs(ditem) - 1];
90
+ counted[abs(ditem) - 1] = N;
91
+ }
92
+ }
93
+ }
94
+ }
95
+ else {
96
+ cout << "!!!!!! No such file exists: " << inst << " !!!!!!\n";
97
+ return 0;
98
+ }
99
+
100
+ if (thresh < 1)
101
+ theta = ceil(thresh * N);
102
+ else
103
+ theta = thresh;
104
+
105
+ int real_L = 0;
106
+ item_dic = vector<int>(L, -1);
107
+ for (int i = 0; i < L; ++i) {
108
+ if (freq[i] >= theta)
109
+ item_dic[i] = ++real_L;
110
+ }
111
+
112
+ cout << "Original number of items: " << L << " Reduced to: " << real_L << endl;
113
+
114
+ L = real_L;
115
+ N = 0;
116
+
117
+
118
+ return 1;
119
+ }
120
+
121
+
122
+ void Load_items_pre(string &inst) {
123
+
124
+ ifstream file(inst);
125
+
126
+ if (file.good()) {
127
+ string line;
128
+ int size_m;
129
+ int ditem;
130
+ bool empty_seq = 0;
131
+ while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
132
+ vector<bool> counted(L, 0);
133
+ istringstream word(line);
134
+ if (!empty_seq) {
135
+ vector<int> temp;
136
+ items.push_back(temp);
137
+ }
138
+ string itm;
139
+ size_m = 0;
140
+ bool sgn = 0;
141
+ empty_seq = 1;
142
+ while (word >> itm) {
143
+
144
+ ditem = stoi(itm);
145
+
146
+ if (item_dic[abs(ditem) - 1] == -1) {
147
+ if (!sgn)
148
+ sgn = ditem < 0;
149
+ continue;
150
+ }
151
+ else {
152
+ if (ditem > 0)
153
+ ditem = item_dic[ditem - 1];
154
+ else
155
+ ditem = -item_dic[-ditem - 1];
156
+ }
157
+
158
+ empty_seq = 0;
159
+
160
+ if (sgn) {
161
+ if (ditem > 0)
162
+ ditem = -ditem;
163
+ sgn = 0;
164
+ }
165
+
166
+ items.back().push_back(ditem);
167
+
168
+ if (!counted[abs(ditem) - 1]) {
169
+ DFS[abs(ditem) - 1].seq_ID.push_back(items.size() - 1);
170
+ DFS[abs(ditem) - 1].str_pnt.push_back(items.back().size() - 1);
171
+ ++DFS[abs(ditem) - 1].freq;
172
+ counted[abs(ditem) - 1] = 1;
173
+ }
174
+
175
+ ++size_m;
176
+ }
177
+
178
+ if (empty_seq)
179
+ continue;
180
+
181
+ ++N;
182
+
183
+ E += size_m;
184
+
185
+ if (size_m > M)
186
+ M = size_m;
187
+
188
+ }
189
+ }
190
+ }
191
+
192
+ bool Load_items(string &inst) {
193
+
194
+ ifstream file(inst);
195
+
196
+ if (file.good()) {
197
+ string line;
198
+ int size_m;
199
+ int ditem;
200
+ while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
201
+ ++N;
202
+ vector<bool> counted(L, 0);
203
+ istringstream word(line);
204
+ items.emplace_back();
205
+ string itm;
206
+ size_m = 0;
207
+ while (word >> itm) {
208
+ ditem = stoi(itm);
209
+ if (L < abs(ditem)) {
210
+ L = abs(ditem);
211
+ while (DFS.size() < L) {
212
+ DFS.emplace_back(-DFS.size() - 1);
213
+ counted.push_back(0);
214
+ }
215
+ }
216
+
217
+ items.back().push_back(ditem);
218
+
219
+ if (!counted[abs(ditem) - 1]) {
220
+ DFS[abs(ditem) - 1].seq_ID.push_back(items.size() - 1);
221
+ DFS[abs(ditem) - 1].str_pnt.push_back(items.back().size() - 1);
222
+ ++DFS[abs(ditem) - 1].freq;
223
+ counted[abs(ditem) - 1] = 1;
224
+ }
225
+
226
+ ++size_m;
227
+ }
228
+
229
+ E += size_m;
230
+
231
+ if (size_m > M)
232
+ M = size_m;
233
+
234
+ }
235
+ }
236
+ else {
237
+ cout << "!!!!!! No such file exists: " << inst << " !!!!!!\n";
238
+ return 0;
239
+ }
240
+
241
+ return 1;
242
+
243
+ }
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
effspm/load_inst.hpp ADDED
@@ -0,0 +1,30 @@
1
+ // effspm/load_inst.hpp
2
+ #pragma once
3
+
4
+ #include <vector>
5
+ #include <string>
6
+ #include <fstream>
7
+ #include <map>
8
+ #include <ctime> // for clock_t
9
+
10
+ using namespace std;
11
+
12
+ // ------------------------------------------------------------
13
+ // forward declare Pattern (defined in freq_miner.hpp)
14
+ struct Pattern;
15
+
16
+ // Main entrypoint: load your file on disk into 'items', build DFS, theta, etc.
17
+ bool Load_instance(string &items_file, double thresh);
18
+
19
+ // storage & globals shared between the C++-CLI & Python bindings
20
+ extern vector<vector<int>> items;
21
+ extern vector<Pattern> DFS; // now Pattern is known
22
+ extern vector<int> item_dic;
23
+
24
+ extern string out_file;
25
+ extern bool b_disp, b_write, use_dic, use_list, pre_pro;
26
+
27
+ extern unsigned int M, L, time_limit;
28
+ extern unsigned long long N, E, theta; // E = total number of entries
29
+
30
+ extern clock_t start_time;
effspm/utility.cpp ADDED
@@ -0,0 +1,55 @@
1
+ #include "utility.hpp"
2
+ #include <iostream>
3
+ #include <fstream>
4
+
5
+ // timing
6
+ std::clock_t start_time;
7
+
8
+ // flags
9
+ bool b_disp = false, b_write = false, use_dic = false, use_list = false, pre_pro = false;
10
+ unsigned int time_limit = 10 * 3600;
11
+ std::string out_file;
12
+
13
+ // storage for Python
14
+ static std::vector<std::vector<int>> collected_patterns;
15
+
16
+ double give_time(std::clock_t end_time) {
17
+ return static_cast<double>(end_time) / CLOCKS_PER_SEC;
18
+ }
19
+
20
+ void ClearCollected() {
21
+ collected_patterns.clear();
22
+ }
23
+
24
+ const std::vector<std::vector<int>>& GetCollected() {
25
+ return collected_patterns;
26
+ }
27
+
28
+ // collect for Python
29
+ void CollectPattern(const std::vector<int>& seq) {
30
+ collected_patterns.push_back(seq);
31
+ }
32
+
33
+ // non-const overload forwards to const version
34
+ void Out_patt(std::vector<int>& seq, unsigned int freq) {
35
+ Out_patt(static_cast<const std::vector<int>&>(seq), freq);
36
+ }
37
+
38
+ // actual implementation
39
+ void Out_patt(const std::vector<int>& seq, unsigned int freq) {
40
+ // 1) collect for Python
41
+ CollectPattern(seq);
42
+
43
+ // 2) optional console output
44
+ if (b_disp) {
45
+ for (int x : seq) std::cout << x << ' ';
46
+ std::cout << "\n************** Freq: " << freq << "\n";
47
+ }
48
+
49
+ // 3) optional file output
50
+ if (b_write) {
51
+ std::ofstream ofs(out_file, std::ios::app);
52
+ for (int x : seq) ofs << x << ' ';
53
+ ofs << "\n************** Freq: " << freq << "\n";
54
+ }
55
+ }
effspm/utility.hpp ADDED
@@ -0,0 +1,29 @@
1
+ #ifndef UTILITY_HPP
2
+ #define UTILITY_HPP
3
+
4
+ #include <vector>
5
+ #include <string>
6
+ #include <ctime>
7
+
8
+ // timing
9
+ extern std::clock_t start_time;
10
+ double give_time(std::clock_t end_time);
11
+
12
+ // flags (shared with main.cpp)
13
+ extern bool b_disp, b_write, use_dic, use_list, pre_pro;
14
+ extern unsigned int time_limit;
15
+ extern std::string out_file;
16
+
17
+ // Python-binding collection
18
+ void ClearCollected();
19
+ const std::vector<std::vector<int>>& GetCollected();
20
+
21
+ // pattern collection & output
22
+ void CollectPattern(const std::vector<int>& seq);
23
+
24
+ // two overloads of Out_patt so calls with non‑const or const vectors both link
25
+ void Out_patt(std::vector<int>& seq, unsigned int freq);
26
+ void Out_patt(const std::vector<int>& seq, unsigned int freq);
27
+
28
+ #endif // UTILITY_HPP
29
+
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: effspm
3
+ Version: 0.1.7
4
+ Summary: Prefix‑Projection sequential pattern mining
5
+ Home-page: https://github.com/yeshu999/effspm
6
+ Author: yeshu999
7
+ Author-email: yeshu999 <vootlayeswanth20@gmail.com>
8
+ Project-URL: Homepage, https://github.com/yeshu999/effspm
9
+ Project-URL: Source, https://github.com/yeshu999/effspm
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: C++
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.7
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pybind11>=2.6
24
+ Dynamic: author
25
+ Dynamic: home-page
26
+ Dynamic: license-file
27
+ Dynamic: requires-python
28
+
29
+ # effspm
30
+
31
+ **Efficient Sequential Pattern Mining via Prefix‑Projection**
32
+
33
+ This library provides a Python interface to mine sequential patterns using the prefix‑projection algorithm, implemented in C++ for performance and exposed via pybind11.
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ pip install effspm
@@ -0,0 +1,14 @@
1
+ effspm-0.1.7.dist-info/RECORD,,
2
+ effspm-0.1.7.dist-info/WHEEL,sha256=DElYocmdrgopNrUdY8SR5gETc6Nry_bwiewfIrlA1RY,141
3
+ effspm-0.1.7.dist-info/top_level.txt,sha256=2O-AuI0nw0pDmJMo2jzM1wvV2rj48AmkjskkAnsuuQk,7
4
+ effspm-0.1.7.dist-info/METADATA,sha256=9Wff5v6cWekQ4c3O11anwulN2lI4pLW9V_DEh2zQmng,1311
5
+ effspm-0.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
6
+ effspm/utility.hpp,sha256=Y_MQVk9AmJWjguKyuyk0LraTi_6VzZFg0StsmVOCkNc,744
7
+ effspm/_core.cpp,sha256=S6UsUcl0HQLMQUTy2tMJxcrbLGJo8tjkLskyHqESYyI,3675
8
+ effspm/load_inst.hpp,sha256=cR-iZG95mUN62ZLCnPNQsKUINtkwhUzMTLlH81wmyt0,906
9
+ effspm/__init__.py,sha256=3fTJ432t0_vjUMnkw4d8I3Jgots4YKVHWnDSHKs_qb4,68
10
+ effspm/freq_miner.cpp,sha256=9K-nO_c-vVzbFlmh511vmvypA2fu1TXpiJhyx03owDU,4642
11
+ effspm/load_inst.cpp,sha256=804fvkfdtYqFMP9Jla6dM2romWWPJmSeCwLm0wEZE5M,4517
12
+ effspm/freq_miner.hpp,sha256=jA-ZCT12Z0YNjLoAiY9sniFTP6g-ITTDuWtlOdHXkMQ,744
13
+ effspm/utility.cpp,sha256=luWwBNy7OVWRmam9gz2RjhtrRmx6c37oOobFJaDWqcA,1403
14
+ effspm/_core.cpython-310-darwin.so,sha256=hIvhsct6RUdw8tSXQKxwaO_dJFfOC8FF2fzLBKKJF64,478128
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (79.0.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-macosx_10_9_universal2
5
+ Generator: delocate 0.13.0
6
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ effspm