effspm 0.1.6__cp313-cp313-macosx_10_13_universal2.whl → 0.1.9__cp313-cp313-macosx_10_13_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 +2 -2
- effspm/_effspm.cpp +153 -0
- effspm/_effspm.cpython-313-darwin.so +0 -0
- effspm/btminer/src/build_mdd.cpp +63 -0
- effspm/btminer/src/build_mdd.hpp +40 -0
- effspm/btminer/src/freq_miner.cpp +176 -0
- effspm/btminer/src/freq_miner.hpp +39 -0
- effspm/btminer/src/load_inst.cpp +194 -0
- effspm/btminer/src/load_inst.hpp +23 -0
- effspm/btminer/src/main.cpp +92 -0
- effspm/btminer/src/utility.cpp +63 -0
- effspm/btminer/src/utility.hpp +41 -0
- effspm/main.cpp +103 -0
- effspm-0.1.9.dist-info/METADATA +237 -0
- effspm-0.1.9.dist-info/RECORD +25 -0
- {effspm-0.1.6.dist-info → effspm-0.1.9.dist-info}/WHEEL +1 -2
- effspm/_core.cpython-313-darwin.so +0 -0
- effspm-0.1.6.dist-info/METADATA +0 -38
- effspm-0.1.6.dist-info/RECORD +0 -14
- {effspm-0.1.6.dist-info → effspm-0.1.9.dist-info}/licenses/LICENSE +0 -0
- {effspm-0.1.6.dist-info → effspm-0.1.9.dist-info}/top_level.txt +0 -0
effspm/__init__.py
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from .
|
|
1
|
+
from ._effspm import PrefixProjection, BTMiner
|
|
2
2
|
|
|
3
|
-
__all__ = ['PrefixProjection']
|
|
3
|
+
__all__ = ['PrefixProjection', 'BTMiner']
|
effspm/_effspm.cpp
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#include <pybind11/pybind11.h>
|
|
2
|
+
#include <pybind11/stl.h>
|
|
3
|
+
|
|
4
|
+
// PrefixProjection headers
|
|
5
|
+
#include "freq_miner.hpp"
|
|
6
|
+
#include "load_inst.hpp"
|
|
7
|
+
#include "utility.hpp"
|
|
8
|
+
|
|
9
|
+
// BTMiner (wrapped in its own namespace in source files)
|
|
10
|
+
#include "btminer/src/freq_miner.hpp"
|
|
11
|
+
#include "btminer/src/load_inst.hpp"
|
|
12
|
+
#include "btminer/src/utility.hpp"
|
|
13
|
+
#include "btminer/src/build_mdd.hpp"
|
|
14
|
+
|
|
15
|
+
namespace py = pybind11;
|
|
16
|
+
|
|
17
|
+
PYBIND11_MODULE(_effspm, m) {
|
|
18
|
+
m.doc() = "Unified SPM library: PrefixProjection, BTMiner, and more";
|
|
19
|
+
|
|
20
|
+
// PrefixProjection
|
|
21
|
+
m.def("PrefixProjection",
|
|
22
|
+
[](py::object data,
|
|
23
|
+
double minsup,
|
|
24
|
+
unsigned int time_limit,
|
|
25
|
+
bool preproc,
|
|
26
|
+
bool use_dic,
|
|
27
|
+
bool verbose,
|
|
28
|
+
const std::string &out_file)
|
|
29
|
+
{
|
|
30
|
+
::time_limit = time_limit;
|
|
31
|
+
::pre_pro = preproc;
|
|
32
|
+
::use_dic = use_dic;
|
|
33
|
+
::use_list = false;
|
|
34
|
+
::b_disp = verbose;
|
|
35
|
+
::b_write = !out_file.empty();
|
|
36
|
+
::out_file = out_file;
|
|
37
|
+
|
|
38
|
+
ClearCollected();
|
|
39
|
+
start_time = std::clock();
|
|
40
|
+
|
|
41
|
+
if (py::isinstance<py::str>(data)) {
|
|
42
|
+
std::string path = data.cast<std::string>();
|
|
43
|
+
if (!Load_instance(path, minsup))
|
|
44
|
+
throw std::runtime_error("Failed to load file: " + path);
|
|
45
|
+
} else {
|
|
46
|
+
auto seqs = data.cast<std::vector<std::vector<int>>>();
|
|
47
|
+
items = std::move(seqs);
|
|
48
|
+
N = items.size();
|
|
49
|
+
|
|
50
|
+
int max_id = 0;
|
|
51
|
+
for (auto &seq : items)
|
|
52
|
+
for (int x : seq)
|
|
53
|
+
max_id = std::max(max_id, std::abs(x));
|
|
54
|
+
L = max_id;
|
|
55
|
+
|
|
56
|
+
theta = (minsup < 1.0) ? std::ceil(minsup * N) : minsup;
|
|
57
|
+
|
|
58
|
+
DFS.clear();
|
|
59
|
+
DFS.reserve(L);
|
|
60
|
+
for (unsigned int i = 0; i < L; ++i)
|
|
61
|
+
DFS.emplace_back(-static_cast<int>(i) - 1);
|
|
62
|
+
|
|
63
|
+
M = 0;
|
|
64
|
+
E = 0;
|
|
65
|
+
for (auto &seq : items) {
|
|
66
|
+
M = std::max<unsigned int>(M, seq.size());
|
|
67
|
+
E += seq.size();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Freq_miner();
|
|
72
|
+
|
|
73
|
+
py::dict out;
|
|
74
|
+
out["patterns"] = GetCollected();
|
|
75
|
+
out["time"] = give_time(std::clock() - start_time);
|
|
76
|
+
return out;
|
|
77
|
+
},
|
|
78
|
+
py::arg("data"),
|
|
79
|
+
py::arg("minsup") = 0.01,
|
|
80
|
+
py::arg("time_limit") = 36000,
|
|
81
|
+
py::arg("preproc") = false,
|
|
82
|
+
py::arg("use_dic") = false,
|
|
83
|
+
py::arg("verbose") = false,
|
|
84
|
+
py::arg("out_file") = ""
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// BTMiner
|
|
88
|
+
m.def("BTMiner",
|
|
89
|
+
[](py::object data,
|
|
90
|
+
double minsup,
|
|
91
|
+
unsigned int time_limit,
|
|
92
|
+
bool preproc,
|
|
93
|
+
bool use_dic,
|
|
94
|
+
bool verbose,
|
|
95
|
+
const std::string &out_file)
|
|
96
|
+
{
|
|
97
|
+
btminer::time_limit = time_limit;
|
|
98
|
+
btminer::pre_pro = preproc;
|
|
99
|
+
btminer::use_dic = use_dic;
|
|
100
|
+
btminer::use_list = false;
|
|
101
|
+
btminer::b_disp = verbose;
|
|
102
|
+
btminer::b_write = !out_file.empty();
|
|
103
|
+
btminer::out_file = out_file;
|
|
104
|
+
|
|
105
|
+
btminer::ClearCollected();
|
|
106
|
+
btminer::start_time = std::clock();
|
|
107
|
+
|
|
108
|
+
if (py::isinstance<py::str>(data)) {
|
|
109
|
+
std::string path = data.cast<std::string>();
|
|
110
|
+
if (!btminer::Load_instance(path, minsup))
|
|
111
|
+
throw std::runtime_error("Failed to load file: " + path);
|
|
112
|
+
} else {
|
|
113
|
+
auto seqs = data.cast<std::vector<std::vector<int>>>();
|
|
114
|
+
btminer::items = std::move(seqs);
|
|
115
|
+
btminer::N = btminer::items.size();
|
|
116
|
+
|
|
117
|
+
int max_id = 0;
|
|
118
|
+
for (auto &seq : btminer::items)
|
|
119
|
+
for (int x : seq)
|
|
120
|
+
max_id = std::max(max_id, std::abs(x));
|
|
121
|
+
btminer::L = max_id;
|
|
122
|
+
|
|
123
|
+
btminer::theta = (minsup < 1.0) ? std::ceil(minsup * btminer::N) : minsup;
|
|
124
|
+
|
|
125
|
+
btminer::DFS.clear();
|
|
126
|
+
btminer::DFS.reserve(btminer::L);
|
|
127
|
+
for (unsigned int i = 0; i < btminer::L; ++i)
|
|
128
|
+
btminer::DFS.emplace_back(-static_cast<int>(i) - 1);
|
|
129
|
+
|
|
130
|
+
btminer::M = 0;
|
|
131
|
+
btminer::E = 0;
|
|
132
|
+
for (auto &seq : btminer::items) {
|
|
133
|
+
btminer::M = std::max<unsigned int>(btminer::M, seq.size());
|
|
134
|
+
btminer::E += seq.size();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
btminer::Freq_miner();
|
|
139
|
+
|
|
140
|
+
py::dict out;
|
|
141
|
+
out["patterns"] = btminer::GetCollected();
|
|
142
|
+
out["time"] = btminer::give_time(std::clock() - btminer::start_time);
|
|
143
|
+
return out;
|
|
144
|
+
},
|
|
145
|
+
py::arg("data"),
|
|
146
|
+
py::arg("minsup") = 0.01,
|
|
147
|
+
py::arg("time_limit") = 36000,
|
|
148
|
+
py::arg("preproc") = false,
|
|
149
|
+
py::arg("use_dic") = false,
|
|
150
|
+
py::arg("verbose") = false,
|
|
151
|
+
py::arg("out_file") = ""
|
|
152
|
+
);
|
|
153
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#include <vector>
|
|
2
|
+
#include <iostream>
|
|
3
|
+
#include <unordered_map>
|
|
4
|
+
#include "load_inst.hpp"
|
|
5
|
+
#include "build_mdd.hpp"
|
|
6
|
+
#include "freq_miner.hpp"
|
|
7
|
+
#include "utility.hpp"
|
|
8
|
+
|
|
9
|
+
namespace btminer {
|
|
10
|
+
|
|
11
|
+
int Add_arc(int item, int last_arc, int& itmset, std::unordered_map<int, int>& ancest_map);
|
|
12
|
+
std::vector<Arc> Tree;
|
|
13
|
+
|
|
14
|
+
void Build_MDD(std::vector<int>& items) {
|
|
15
|
+
std::unordered_map<int, int> ancest_map;
|
|
16
|
+
int last_arc = 0, itmset = 0;
|
|
17
|
+
for (auto it = items.begin(); it != items.end(); ++it)
|
|
18
|
+
last_arc = Add_arc(*it, last_arc, itmset, ancest_map);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
int Add_arc(int item, int last_arc, int& itmset, std::unordered_map<int, int>& ancest_map) {
|
|
22
|
+
int anct;
|
|
23
|
+
auto p = ancest_map.find(abs(item));
|
|
24
|
+
if (p == ancest_map.end())
|
|
25
|
+
anct = 0;
|
|
26
|
+
else
|
|
27
|
+
anct = p->second;
|
|
28
|
+
|
|
29
|
+
if (item < 0)
|
|
30
|
+
++itmset;
|
|
31
|
+
|
|
32
|
+
int last_sibl = Tree[last_arc].chld;
|
|
33
|
+
|
|
34
|
+
if (last_sibl == -1) {
|
|
35
|
+
Tree.emplace_back(item, itmset, anct);
|
|
36
|
+
last_sibl = Tree.size() - 1;
|
|
37
|
+
Tree[last_arc].chld = last_sibl;
|
|
38
|
+
if (anct == 0)
|
|
39
|
+
DFS[abs(item) - 1].str_pnt.push_back(last_sibl);
|
|
40
|
+
} else {
|
|
41
|
+
while (Tree[last_sibl].item != item) {
|
|
42
|
+
if (Tree[last_sibl].sibl == -1) {
|
|
43
|
+
Tree.emplace_back(item, itmset, anct);
|
|
44
|
+
Tree[last_sibl].sibl = Tree.size() - 1;
|
|
45
|
+
last_sibl = Tree.size() - 1;
|
|
46
|
+
if (anct == 0)
|
|
47
|
+
DFS[abs(item) - 1].str_pnt.push_back(last_sibl);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
last_sibl = Tree[last_sibl].sibl;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (anct == 0)
|
|
55
|
+
++DFS[abs(item) - 1].freq;
|
|
56
|
+
|
|
57
|
+
++Tree[last_sibl].freq;
|
|
58
|
+
ancest_map[abs(item)] = last_sibl;
|
|
59
|
+
|
|
60
|
+
return last_sibl;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
} // namespace btminer
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <cmath>
|
|
5
|
+
#include "load_inst.hpp"
|
|
6
|
+
|
|
7
|
+
namespace btminer {
|
|
8
|
+
|
|
9
|
+
void Build_MDD(std::vector<int>& items);
|
|
10
|
+
|
|
11
|
+
class Arc {
|
|
12
|
+
public:
|
|
13
|
+
int chld = -1;
|
|
14
|
+
int sibl = -1;
|
|
15
|
+
int freq = 0;
|
|
16
|
+
int anct;
|
|
17
|
+
int itmset;
|
|
18
|
+
int item;
|
|
19
|
+
|
|
20
|
+
Arc(int _itm, int _itmset, int _anc) {
|
|
21
|
+
itmset = _itmset;
|
|
22
|
+
anct = _anc;
|
|
23
|
+
item = _itm;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Arc(int _itm, int _anc) {
|
|
27
|
+
item = _itm;
|
|
28
|
+
anct = _anc;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Arc() {
|
|
32
|
+
chld = -1;
|
|
33
|
+
sibl = -1;
|
|
34
|
+
freq = 0;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
extern std::vector<Arc> Tree;
|
|
39
|
+
|
|
40
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <time.h>
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <fstream>
|
|
5
|
+
#include <cmath>
|
|
6
|
+
#include "freq_miner.hpp"
|
|
7
|
+
#include "build_mdd.hpp"
|
|
8
|
+
#include "utility.hpp"
|
|
9
|
+
|
|
10
|
+
namespace btminer {
|
|
11
|
+
|
|
12
|
+
void Out_patt(std::vector<int>& seq, int freq);
|
|
13
|
+
void Extend_patt(Pattern _patt);
|
|
14
|
+
|
|
15
|
+
int num_patt = 0;
|
|
16
|
+
|
|
17
|
+
void Freq_miner() {
|
|
18
|
+
std::vector<int> islist;
|
|
19
|
+
for (int i = 0; i < L; ++i) {
|
|
20
|
+
if (DFS[i].freq >= theta)
|
|
21
|
+
islist.push_back(i);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
for (int i = 0; i < DFS.size(); ++i) {
|
|
25
|
+
DFS[i].ilist = islist;
|
|
26
|
+
DFS[i].slist = islist;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
while (!DFS.empty() && give_time(clock() - start_time) < time_limit) {
|
|
30
|
+
if (DFS.back().freq >= theta)
|
|
31
|
+
Extend_patt(DFS.back());
|
|
32
|
+
else
|
|
33
|
+
DFS.pop_back();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void Extend_patt(Pattern _patt) {
|
|
38
|
+
DFS.pop_back();
|
|
39
|
+
std::vector<bool> slist(L, 0);
|
|
40
|
+
std::vector<bool> ilist(L, 0);
|
|
41
|
+
|
|
42
|
+
for (auto it : _patt.slist) slist[it] = 1;
|
|
43
|
+
for (auto it : _patt.ilist) ilist[it] = 1;
|
|
44
|
+
|
|
45
|
+
int itmset_size = 1;
|
|
46
|
+
int last_neg = _patt.seq.size() - 1;
|
|
47
|
+
while (_patt.seq[last_neg] > 0) {
|
|
48
|
+
--last_neg;
|
|
49
|
+
++itmset_size;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
std::vector<Pattern> pot_patt(2 * L);
|
|
53
|
+
std::vector<int> DFS_patt_init, DFS_patt, DFS_numfound, last_strpnt(L, 0);
|
|
54
|
+
|
|
55
|
+
for (int pnt = 0; pnt < _patt.str_pnt.size(); ++pnt) {
|
|
56
|
+
DFS_patt_init.push_back(_patt.str_pnt[pnt]);
|
|
57
|
+
while (!DFS_patt_init.empty()) {
|
|
58
|
+
int cur_sibl = Tree[DFS_patt_init.back()].chld;
|
|
59
|
+
DFS_patt_init.pop_back();
|
|
60
|
+
while (cur_sibl != -1) {
|
|
61
|
+
int cur_itm = Tree[cur_sibl].item;
|
|
62
|
+
if (cur_itm < 0) {
|
|
63
|
+
cur_itm = -cur_itm;
|
|
64
|
+
if (slist[cur_itm - 1]) {
|
|
65
|
+
pot_patt[cur_itm + L - 1].freq += Tree[cur_sibl].freq;
|
|
66
|
+
pot_patt[cur_itm + L - 1].str_pnt.push_back(cur_sibl);
|
|
67
|
+
}
|
|
68
|
+
if (Tree[cur_sibl].chld != -1) {
|
|
69
|
+
DFS_patt.push_back(cur_sibl);
|
|
70
|
+
DFS_numfound.push_back(cur_itm == -_patt.seq[last_neg] ? 1 : 0);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
if (ilist[cur_itm - 1]) {
|
|
74
|
+
pot_patt[cur_itm - 1].freq += Tree[cur_sibl].freq;
|
|
75
|
+
pot_patt[cur_itm - 1].str_pnt.push_back(cur_sibl);
|
|
76
|
+
}
|
|
77
|
+
if (Tree[cur_sibl].chld != -1)
|
|
78
|
+
DFS_patt_init.push_back(cur_sibl);
|
|
79
|
+
}
|
|
80
|
+
cur_sibl = Tree[cur_sibl].sibl;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
for (auto it : _patt.ilist)
|
|
85
|
+
last_strpnt[it] = pot_patt[it].str_pnt.size();
|
|
86
|
+
|
|
87
|
+
while (!DFS_patt.empty()) {
|
|
88
|
+
int cur_sibl = Tree[DFS_patt.back()].chld;
|
|
89
|
+
int num_found = DFS_numfound.back();
|
|
90
|
+
DFS_patt.pop_back();
|
|
91
|
+
DFS_numfound.pop_back();
|
|
92
|
+
while (cur_sibl != -1) {
|
|
93
|
+
int cur_itm = Tree[cur_sibl].item;
|
|
94
|
+
if (cur_itm > 0) {
|
|
95
|
+
if (num_found == itmset_size && ilist[cur_itm - 1] &&
|
|
96
|
+
(Tree[Tree[cur_sibl].anct].itmset < Tree[_patt.str_pnt[pnt]].itmset ||
|
|
97
|
+
!check_parent(cur_sibl, _patt.str_pnt[pnt], last_strpnt[cur_itm - 1], pot_patt[cur_itm - 1].str_pnt))) {
|
|
98
|
+
pot_patt[cur_itm - 1].freq += Tree[cur_sibl].freq;
|
|
99
|
+
pot_patt[cur_itm - 1].str_pnt.push_back(cur_sibl);
|
|
100
|
+
}
|
|
101
|
+
if (slist[cur_itm - 1] && Tree[Tree[cur_sibl].anct].itmset <= Tree[_patt.str_pnt[pnt]].itmset) {
|
|
102
|
+
pot_patt[cur_itm + L - 1].freq += Tree[cur_sibl].freq;
|
|
103
|
+
pot_patt[cur_itm + L - 1].str_pnt.push_back(cur_sibl);
|
|
104
|
+
}
|
|
105
|
+
if (Tree[cur_sibl].chld != -1) {
|
|
106
|
+
DFS_patt.push_back(cur_sibl);
|
|
107
|
+
if (!_patt.ilist.empty()) {
|
|
108
|
+
DFS_numfound.push_back((num_found < itmset_size && cur_itm == abs(_patt.seq[last_neg + num_found])) ? num_found + 1 : num_found);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
cur_itm = -cur_itm;
|
|
113
|
+
if (slist[cur_itm - 1] && Tree[Tree[cur_sibl].anct].itmset <= Tree[_patt.str_pnt[pnt]].itmset) {
|
|
114
|
+
pot_patt[cur_itm + L - 1].freq += Tree[cur_sibl].freq;
|
|
115
|
+
pot_patt[cur_itm + L - 1].str_pnt.push_back(cur_sibl);
|
|
116
|
+
}
|
|
117
|
+
if (Tree[cur_sibl].chld != -1) {
|
|
118
|
+
DFS_patt.push_back(cur_sibl);
|
|
119
|
+
if (!_patt.ilist.empty()) {
|
|
120
|
+
DFS_numfound.push_back(cur_itm == -_patt.seq[last_neg] ? 1 : 0);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
cur_sibl = Tree[cur_sibl].sibl;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
std::vector<int> slistp, ilistp;
|
|
130
|
+
for (auto it : _patt.ilist) if (pot_patt[it].freq >= theta) ilistp.push_back(it);
|
|
131
|
+
for (auto it : _patt.slist) if (pot_patt[it + L].freq >= theta) slistp.push_back(it);
|
|
132
|
+
|
|
133
|
+
for (auto it : ilistp) {
|
|
134
|
+
pot_patt[it].str_pnt.shrink_to_fit();
|
|
135
|
+
DFS.push_back(pot_patt[it]);
|
|
136
|
+
DFS.back().seq = _patt.seq;
|
|
137
|
+
DFS.back().seq.push_back(it + 1);
|
|
138
|
+
DFS.back().seq.shrink_to_fit();
|
|
139
|
+
DFS.back().slist = slistp;
|
|
140
|
+
DFS.back().ilist = ilistp;
|
|
141
|
+
if (b_disp || b_write) Out_patt(DFS.back().seq, DFS.back().freq);
|
|
142
|
+
++num_patt;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (auto it : slistp) {
|
|
146
|
+
pot_patt[it + L].str_pnt.shrink_to_fit();
|
|
147
|
+
DFS.push_back(pot_patt[it + L]);
|
|
148
|
+
DFS.back().seq = _patt.seq;
|
|
149
|
+
DFS.back().seq.push_back(-it - 1);
|
|
150
|
+
DFS.back().seq.shrink_to_fit();
|
|
151
|
+
DFS.back().slist = slistp;
|
|
152
|
+
DFS.back().ilist = slistp;
|
|
153
|
+
if (b_disp || b_write) Out_patt(DFS.back().seq, DFS.back().freq);
|
|
154
|
+
++num_patt;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
void Out_patt(std::vector<int>& seq, int freq) {
|
|
159
|
+
std::ofstream file_o;
|
|
160
|
+
if (b_write) file_o.open(out_file, std::ios::app);
|
|
161
|
+
|
|
162
|
+
for (int ii = 0; ii < seq.size(); ii++) {
|
|
163
|
+
if (b_disp) std::cout << seq[ii] << " ";
|
|
164
|
+
if (b_write) file_o << seq[ii] << " ";
|
|
165
|
+
}
|
|
166
|
+
if (b_disp) std::cout << std::endl;
|
|
167
|
+
if (b_write) file_o << std::endl;
|
|
168
|
+
|
|
169
|
+
if (b_disp) std::cout << "************** Freq: " << freq << std::endl;
|
|
170
|
+
if (b_write) {
|
|
171
|
+
file_o << "************** Freq: " << freq << std::endl;
|
|
172
|
+
file_o.close();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
} // namespace btminer
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include "load_inst.hpp"
|
|
5
|
+
#include "build_mdd.hpp"
|
|
6
|
+
|
|
7
|
+
namespace btminer {
|
|
8
|
+
|
|
9
|
+
void Freq_miner();
|
|
10
|
+
|
|
11
|
+
class Pattern {
|
|
12
|
+
public:
|
|
13
|
+
std::vector<int> seq;
|
|
14
|
+
std::vector<int> str_pnt;
|
|
15
|
+
std::vector<int> slist;
|
|
16
|
+
std::vector<int> ilist;
|
|
17
|
+
int freq;
|
|
18
|
+
|
|
19
|
+
Pattern(std::vector<int>& _seq, int item) {
|
|
20
|
+
seq.swap(_seq);
|
|
21
|
+
seq.push_back(item);
|
|
22
|
+
freq = 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Pattern(int item) {
|
|
26
|
+
seq.push_back(item);
|
|
27
|
+
freq = 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Pattern() {
|
|
31
|
+
freq = 0;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
extern int num_patt;
|
|
36
|
+
extern int num_max_patt;
|
|
37
|
+
extern std::vector<Pattern> DFS;
|
|
38
|
+
|
|
39
|
+
} // namespace btminer
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <sstream>
|
|
3
|
+
#include <fstream>
|
|
4
|
+
#include <cmath>
|
|
5
|
+
#include <ctime>
|
|
6
|
+
#include <map>
|
|
7
|
+
#include <vector>
|
|
8
|
+
#include <algorithm>
|
|
9
|
+
#include "load_inst.hpp"
|
|
10
|
+
#include "utility.hpp"
|
|
11
|
+
#include "build_mdd.hpp"
|
|
12
|
+
#include "freq_miner.hpp"
|
|
13
|
+
|
|
14
|
+
namespace btminer {
|
|
15
|
+
|
|
16
|
+
using namespace std;
|
|
17
|
+
|
|
18
|
+
extern int num_nodes, cur_node; // ✅ keep these if needed
|
|
19
|
+
|
|
20
|
+
map<string, int> item_map;
|
|
21
|
+
map<int, string> item_map_rev;
|
|
22
|
+
vector<int> freq;
|
|
23
|
+
vector<int> item_dic;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
void Load_items_pre(string& inst_name);
|
|
27
|
+
bool Load_items(string& inst_name);
|
|
28
|
+
bool Preprocess(string& inst, double thresh);
|
|
29
|
+
|
|
30
|
+
bool Load_instance(string& items_file, double thresh) {
|
|
31
|
+
clock_t kk = clock();
|
|
32
|
+
Tree.emplace_back(0, 0, 0);
|
|
33
|
+
|
|
34
|
+
if (pre_pro) {
|
|
35
|
+
if (!Preprocess(items_file, thresh))
|
|
36
|
+
return false;
|
|
37
|
+
|
|
38
|
+
cout << "\nPreprocess done in " << give_time(clock() - kk) << " seconds\n\n";
|
|
39
|
+
|
|
40
|
+
DFS.reserve(L);
|
|
41
|
+
for (int i = 0; i < L; ++i)
|
|
42
|
+
DFS.emplace_back(-i - 1);
|
|
43
|
+
|
|
44
|
+
kk = clock();
|
|
45
|
+
Load_items_pre(items_file);
|
|
46
|
+
} else if (!Load_items(items_file))
|
|
47
|
+
return false;
|
|
48
|
+
else {
|
|
49
|
+
theta = (thresh < 1) ? ceil(thresh * N * N_mult) : thresh;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
cout << "\nMDD Database built in " << give_time(clock() - kk) << " seconds\n\n";
|
|
53
|
+
cout << "Found " << N * N_mult << " sequence, with max line len " << M << ", and " << L << " items, and " << E << " enteries\n";
|
|
54
|
+
cout << "Total MDD nodes: " << Tree.size() << endl;
|
|
55
|
+
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
bool Preprocess(string& inst, double thresh) {
|
|
60
|
+
ifstream file(inst);
|
|
61
|
+
if (!file.good()) {
|
|
62
|
+
cout << "!!!!!! No such file exists: " << inst << " !!!!!!\n";
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
string line;
|
|
67
|
+
int size_m, ditem;
|
|
68
|
+
while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
|
|
69
|
+
++N;
|
|
70
|
+
vector<bool> counted(L, 0);
|
|
71
|
+
istringstream word(line);
|
|
72
|
+
string itm;
|
|
73
|
+
while (word >> itm) {
|
|
74
|
+
ditem = stoi(itm);
|
|
75
|
+
if (L < abs(ditem)) L = abs(ditem);
|
|
76
|
+
while (freq.size() < L) {
|
|
77
|
+
freq.push_back(0);
|
|
78
|
+
counted.push_back(0);
|
|
79
|
+
}
|
|
80
|
+
if (!counted[abs(ditem) - 1]) {
|
|
81
|
+
++freq[abs(ditem) - 1];
|
|
82
|
+
counted[abs(ditem) - 1] = 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
theta = (thresh < 1) ? ceil(thresh * N * N_mult) : thresh;
|
|
88
|
+
|
|
89
|
+
int real_L = 0;
|
|
90
|
+
item_dic = vector<int>(L, -1);
|
|
91
|
+
for (int i = 0; i < L; ++i) {
|
|
92
|
+
if (freq[i] >= theta)
|
|
93
|
+
item_dic[i] = ++real_L;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
cout << "Original number of items: " << L << " Reduced to: " << real_L << endl;
|
|
97
|
+
L = real_L;
|
|
98
|
+
N = 0;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void Load_items_pre(string& inst_name) {
|
|
103
|
+
ifstream file(inst_name);
|
|
104
|
+
if (!file.good()) return;
|
|
105
|
+
|
|
106
|
+
string line;
|
|
107
|
+
int ditem;
|
|
108
|
+
while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
|
|
109
|
+
istringstream word(line);
|
|
110
|
+
string itm;
|
|
111
|
+
vector<int> temp_vec;
|
|
112
|
+
bool sgn = 0;
|
|
113
|
+
while (word >> itm) {
|
|
114
|
+
if (use_dic) {
|
|
115
|
+
auto it = item_map.find(itm);
|
|
116
|
+
if (it == item_map.end()) {
|
|
117
|
+
item_map[itm] = ++L;
|
|
118
|
+
item_map_rev[L] = itm;
|
|
119
|
+
ditem = L;
|
|
120
|
+
} else {
|
|
121
|
+
ditem = it->second;
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
ditem = stoi(itm);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (freq[abs(ditem) - 1] < theta) {
|
|
128
|
+
if (!sgn)
|
|
129
|
+
sgn = ditem < 0;
|
|
130
|
+
continue;
|
|
131
|
+
} else {
|
|
132
|
+
ditem = (ditem > 0) ? item_dic[ditem - 1] : -item_dic[-ditem - 1];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (sgn && ditem > 0)
|
|
136
|
+
ditem = -ditem;
|
|
137
|
+
sgn = 0;
|
|
138
|
+
|
|
139
|
+
temp_vec.push_back(ditem);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (temp_vec.empty()) continue;
|
|
143
|
+
|
|
144
|
+
++N;
|
|
145
|
+
if (temp_vec.size() > M) M = temp_vec.size();
|
|
146
|
+
|
|
147
|
+
Build_MDD(temp_vec);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
bool Load_items(string& inst_name) {
|
|
152
|
+
ifstream file(inst_name);
|
|
153
|
+
if (!file.good()) {
|
|
154
|
+
cout << "!!!!!! No such file exists: " << inst_name << " !!!!!!\n";
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
string line;
|
|
159
|
+
int ditem;
|
|
160
|
+
while (getline(file, line) && give_time(clock() - start_time) < time_limit) {
|
|
161
|
+
++N;
|
|
162
|
+
istringstream word(line);
|
|
163
|
+
string itm;
|
|
164
|
+
vector<int> temp_vec;
|
|
165
|
+
while (word >> itm) {
|
|
166
|
+
if (use_dic) {
|
|
167
|
+
auto it = item_map.find(itm);
|
|
168
|
+
if (it == item_map.end()) {
|
|
169
|
+
item_map[itm] = ++L;
|
|
170
|
+
item_map_rev[L] = itm;
|
|
171
|
+
ditem = L;
|
|
172
|
+
} else {
|
|
173
|
+
ditem = it->second;
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
ditem = stoi(itm);
|
|
177
|
+
if (L < abs(ditem)) {
|
|
178
|
+
L = abs(ditem);
|
|
179
|
+
while (DFS.size() < L && !just_build) {
|
|
180
|
+
DFS.reserve(L);
|
|
181
|
+
DFS.emplace_back(-DFS.size() - 1);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
temp_vec.push_back(ditem);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (temp_vec.size() > M) M = temp_vec.size();
|
|
189
|
+
Build_MDD(temp_vec);
|
|
190
|
+
}
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
} // namespace btminer
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <fstream>
|
|
6
|
+
#include <map>
|
|
7
|
+
#include <unordered_set>
|
|
8
|
+
#include <unordered_map>
|
|
9
|
+
#include <ctime>
|
|
10
|
+
|
|
11
|
+
namespace btminer {
|
|
12
|
+
|
|
13
|
+
bool Load_instance(std::string& items_file, double thresh);
|
|
14
|
+
|
|
15
|
+
extern std::string out_file, folder;
|
|
16
|
+
|
|
17
|
+
extern bool b_disp, b_write, use_dic, just_build, pre_pro;
|
|
18
|
+
|
|
19
|
+
extern int N, M, L, theta, num_nodes, M_mult, N_mult, time_limit, cur_node;
|
|
20
|
+
|
|
21
|
+
extern clock_t start_time;
|
|
22
|
+
|
|
23
|
+
} // namespace btminer
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <ctime>
|
|
3
|
+
#include <cstring>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include "load_inst.hpp"
|
|
6
|
+
#include "build_mdd.hpp"
|
|
7
|
+
#include "utility.hpp"
|
|
8
|
+
#include "freq_miner.hpp"
|
|
9
|
+
|
|
10
|
+
namespace btminer {
|
|
11
|
+
|
|
12
|
+
// These variables are declared in utility.hpp and defined in utility.cpp
|
|
13
|
+
extern std::string out_file;
|
|
14
|
+
extern bool b_disp, b_write, use_dic, just_build;
|
|
15
|
+
extern clock_t start_time;
|
|
16
|
+
|
|
17
|
+
bool pre_pro = true; // This one is only used in main
|
|
18
|
+
int N_mult = 1, M_mult = 1; // Local to main
|
|
19
|
+
int time_limit = 30 * 3600; // Local to main
|
|
20
|
+
std::string folder;
|
|
21
|
+
|
|
22
|
+
int main(int argc, char* argv[]) {
|
|
23
|
+
std::string VV, attr;
|
|
24
|
+
double thresh = 0;
|
|
25
|
+
|
|
26
|
+
for (int i = 1; i < argc; i++) {
|
|
27
|
+
if (argv[i][0] != '-' || isdigit(argv[i][1]))
|
|
28
|
+
continue;
|
|
29
|
+
else if (strcmp(argv[i], "-thr") == 0)
|
|
30
|
+
thresh = std::stod(argv[i + 1]);
|
|
31
|
+
else if (strcmp(argv[i], "-file") == 0)
|
|
32
|
+
VV = argv[i + 1];
|
|
33
|
+
else if (strcmp(argv[i], "-N_mult") == 0)
|
|
34
|
+
N_mult = std::stoi(argv[i + 1]);
|
|
35
|
+
else if (strcmp(argv[i], "-M_mult") == 0)
|
|
36
|
+
M_mult = std::stoi(argv[i + 1]);
|
|
37
|
+
else if (strcmp(argv[i], "-time") == 0)
|
|
38
|
+
time_limit = std::stoi(argv[i + 1]);
|
|
39
|
+
else if (strcmp(argv[i], "-jbuild") == 0)
|
|
40
|
+
just_build = true;
|
|
41
|
+
else if (strcmp(argv[i], "-folder") == 0)
|
|
42
|
+
folder = argv[i + 1];
|
|
43
|
+
else if (strcmp(argv[i], "-npre") == 0)
|
|
44
|
+
pre_pro = false;
|
|
45
|
+
else if (strcmp(argv[i], "-dic") == 0)
|
|
46
|
+
use_dic = true;
|
|
47
|
+
else if (strcmp(argv[i], "-out") == 0) {
|
|
48
|
+
if (i + 1 == argc || argv[i + 1][0] == '-')
|
|
49
|
+
b_disp = true;
|
|
50
|
+
else if (argv[i + 1][0] == '+') {
|
|
51
|
+
b_disp = true;
|
|
52
|
+
b_write = true;
|
|
53
|
+
if (strlen(argv[i + 1]) > 1) {
|
|
54
|
+
out_file = argv[i + 1];
|
|
55
|
+
out_file = out_file.substr(1);
|
|
56
|
+
} else {
|
|
57
|
+
out_file = VV;
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
b_write = true;
|
|
61
|
+
out_file = argv[i + 1];
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
std::cout << "Command " << argv[i] << " not recognized and skipped.\n";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
std::cout << "\n********************** " << VV << " N_mult: " << N_mult << " M_mult: " << M_mult << "**********************\n";
|
|
69
|
+
|
|
70
|
+
std::string item_file = folder + VV + ".txt";
|
|
71
|
+
|
|
72
|
+
std::cout << "loading instances...\n";
|
|
73
|
+
start_time = clock();
|
|
74
|
+
|
|
75
|
+
if (!Load_instance(item_file, thresh)) {
|
|
76
|
+
std::cout << "Files invalid, exiting.\n";
|
|
77
|
+
std::cin.get();
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!just_build && give_time(clock() - start_time) < time_limit) {
|
|
82
|
+
Freq_miner();
|
|
83
|
+
if (give_time(clock() - start_time) >= time_limit)
|
|
84
|
+
std::cout << "TIME LIMIT REACHED\n";
|
|
85
|
+
std::cout << "Mining Complete\n\nFound a total of " << num_patt << " patterns\n";
|
|
86
|
+
std::cout << "\nTotal CPU time " << give_time(clock() - start_time) << " seconds\n\n";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
} // namespace btminer
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#include "utility.hpp"
|
|
2
|
+
#include "build_mdd.hpp"
|
|
3
|
+
#include "load_inst.hpp"
|
|
4
|
+
#include <iostream>
|
|
5
|
+
|
|
6
|
+
namespace btminer {
|
|
7
|
+
|
|
8
|
+
// === Global Variables ===
|
|
9
|
+
std::vector<std::vector<int>> items;
|
|
10
|
+
bool use_list = false;
|
|
11
|
+
bool just_build = false;
|
|
12
|
+
int E = 0, M = 0, N = 0, L = 0, theta = 0;
|
|
13
|
+
std::vector<Pattern> DFS;
|
|
14
|
+
clock_t start_time;
|
|
15
|
+
bool b_disp = false, b_write = false;
|
|
16
|
+
std::string out_file;
|
|
17
|
+
int time_limit = 30 * 3600; // ✅ This was missing before
|
|
18
|
+
|
|
19
|
+
// === Function Definitions ===
|
|
20
|
+
|
|
21
|
+
int find_ID(std::vector<int>& vec, int itm) {
|
|
22
|
+
int plc = 0;
|
|
23
|
+
while (plc < vec.size() && vec[plc] != itm)
|
|
24
|
+
++plc;
|
|
25
|
+
return (plc == vec.size()) ? -1 : plc;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
bool check_parent(int cur_arc, int str_pnt, int start, std::vector<int>& strpnt_vec) {
|
|
29
|
+
std::vector<int> ancestors;
|
|
30
|
+
int cur_anct = Tree[cur_arc].anct;
|
|
31
|
+
|
|
32
|
+
while (Tree[cur_anct].itmset > Tree[str_pnt].itmset) {
|
|
33
|
+
if (Tree[cur_anct].item > 0)
|
|
34
|
+
ancestors.push_back(cur_anct);
|
|
35
|
+
cur_anct = Tree[cur_anct].anct;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (Tree[cur_anct].itmset == Tree[str_pnt].itmset)
|
|
39
|
+
return true;
|
|
40
|
+
|
|
41
|
+
for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
|
|
42
|
+
for (int i = start; i < strpnt_vec.size(); ++i) {
|
|
43
|
+
if (strpnt_vec[i] == *it)
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
bool find_pnt(Arc* pnt, std::vector<Arc*>& vec, int pos) {
|
|
52
|
+
for (size_t i = pos; i < vec.size(); ++i) {
|
|
53
|
+
if (vec[i] == pnt)
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
float give_time(clock_t kk) {
|
|
60
|
+
return static_cast<float>(kk) / CLOCKS_PER_SEC;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
} // namespace btminer
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <ctime>
|
|
5
|
+
#include <string>
|
|
6
|
+
#include "build_mdd.hpp"
|
|
7
|
+
#include "freq_miner.hpp" // Required for Pattern
|
|
8
|
+
#include "load_inst.hpp" // Ensures consistency across global usage
|
|
9
|
+
|
|
10
|
+
namespace btminer {
|
|
11
|
+
|
|
12
|
+
// === Utility function declarations ===
|
|
13
|
+
bool find_pnt(Arc* pnt, std::vector<Arc*>& vec, int pos);
|
|
14
|
+
int find_ID(std::vector<int>& vec, int itm);
|
|
15
|
+
float give_time(clock_t kk);
|
|
16
|
+
bool check_parent(int cur_arc, int str_pnt, int start, std::vector<int>& strpnt_vec);
|
|
17
|
+
|
|
18
|
+
// === Global variables for Python binding support ===
|
|
19
|
+
extern std::vector<std::vector<int>> items;
|
|
20
|
+
extern bool use_list;
|
|
21
|
+
extern bool just_build;
|
|
22
|
+
extern int E, M, N, L, theta;
|
|
23
|
+
extern std::vector<Pattern> DFS;
|
|
24
|
+
extern clock_t start_time;
|
|
25
|
+
extern bool b_disp, b_write;
|
|
26
|
+
extern std::string out_file;
|
|
27
|
+
|
|
28
|
+
// === Python-friendly accessors ===
|
|
29
|
+
inline void ClearCollected() {
|
|
30
|
+
DFS.clear();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
inline std::vector<std::vector<int>> GetCollected() {
|
|
34
|
+
std::vector<std::vector<int>> patterns;
|
|
35
|
+
for (const auto& p : DFS) {
|
|
36
|
+
patterns.push_back(p.seq);
|
|
37
|
+
}
|
|
38
|
+
return patterns;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
} // namespace btminer
|
effspm/main.cpp
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <time.h>
|
|
3
|
+
#include <string.h>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include "load_inst.hpp"
|
|
6
|
+
#include "freq_miner.hpp"
|
|
7
|
+
#include "utility.hpp"
|
|
8
|
+
|
|
9
|
+
using namespace std;
|
|
10
|
+
|
|
11
|
+
string out_file;
|
|
12
|
+
|
|
13
|
+
bool b_disp = 0, b_write = 0, use_dic = 0, use_list = 0, pre_pro = 0;
|
|
14
|
+
|
|
15
|
+
unsigned int time_limit = 10 * 3600;
|
|
16
|
+
|
|
17
|
+
clock_t start_time;
|
|
18
|
+
|
|
19
|
+
int main(int argc, char* argv[]) {
|
|
20
|
+
|
|
21
|
+
double thresh = 0;
|
|
22
|
+
string VV, folder;
|
|
23
|
+
for (int i = 1; i < argc; ++i){
|
|
24
|
+
if (argv[i][0] !='-')
|
|
25
|
+
continue;
|
|
26
|
+
else if (strcmp(argv[i], "-thr") == 0)
|
|
27
|
+
thresh = stof(argv[i + 1]);
|
|
28
|
+
else if (strcmp(argv[i], "-file") == 0)
|
|
29
|
+
VV = argv[i + 1];
|
|
30
|
+
else if (strcmp(argv[i], "-folder") == 0)
|
|
31
|
+
folder = argv[i + 1];
|
|
32
|
+
else if (strcmp(argv[i], "-time") == 0)
|
|
33
|
+
time_limit = stoi(argv[i + 1]);
|
|
34
|
+
else if (strcmp(argv[i], "-uselist") == 0)
|
|
35
|
+
use_list = 1;
|
|
36
|
+
else if (strcmp(argv[i], "-preproc") == 0)
|
|
37
|
+
pre_pro = 1;
|
|
38
|
+
else if (strcmp(argv[i], "-dic") == 0)
|
|
39
|
+
use_dic = 1;
|
|
40
|
+
else if (strcmp(argv[i], "-out") == 0){
|
|
41
|
+
if (i + 1 == argc || argv[i + 1][0] == '-')
|
|
42
|
+
b_disp = 1;
|
|
43
|
+
else if (argv[i + 1][0] == '+') {
|
|
44
|
+
b_disp = 1;
|
|
45
|
+
b_write = 1;
|
|
46
|
+
out_file = argv[i + 1];
|
|
47
|
+
out_file = out_file.substr(1,out_file.size()-1);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
b_write = 1;
|
|
51
|
+
out_file = argv[i + 1];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
cout << "Command " << argv[i] << " not recognized and skipped.\n";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (thresh == 0){
|
|
59
|
+
cout << "No Threshold given, using threshold deafult of 1%\n";
|
|
60
|
+
thresh = 0.01;
|
|
61
|
+
}
|
|
62
|
+
if (folder.back() != '/'){
|
|
63
|
+
folder += '/';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
cout << "\n********************** " << VV << "**********************\n";
|
|
68
|
+
|
|
69
|
+
string item_file = folder + VV + ".txt";
|
|
70
|
+
//out_file = folder + VV + "_result.txt";
|
|
71
|
+
cout << "loading instances...\n";
|
|
72
|
+
|
|
73
|
+
start_time = clock();
|
|
74
|
+
|
|
75
|
+
if(!Load_instance(item_file, thresh)){
|
|
76
|
+
cout << "Files invalid, exiting.\n";
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
cout << "Instances loaded\n";
|
|
81
|
+
|
|
82
|
+
if (give_time(clock() - start_time) < time_limit) {
|
|
83
|
+
cout << "\nRunning mining algorithm...\n";
|
|
84
|
+
Freq_miner();
|
|
85
|
+
if (give_time(clock() - start_time) >= time_limit)
|
|
86
|
+
cout << "TIME LIMIT REACHED\n";
|
|
87
|
+
cout << "Mining Complete\n\nFound a total of " << num_patt << " patterns\n";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
cout << "Total CPU time is: ";
|
|
91
|
+
cout << give_time(clock() - start_time) << "\n";
|
|
92
|
+
|
|
93
|
+
if (b_write){
|
|
94
|
+
ofstream file;
|
|
95
|
+
file.open(out_file, std::ios::app);
|
|
96
|
+
file << "\nMining completed in " << give_time(clock() - start_time) << " seconds\n";
|
|
97
|
+
//file << "Found a total of " << num_max_patt << " maximal patterns\n";
|
|
98
|
+
file.close();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: effspm
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
Summary: Prefix‑Projection and other sequential pattern mining algorithms
|
|
5
|
+
Author: Yeswanth Vootla
|
|
6
|
+
Author-email: yeshu999 <vootlayeswanth20@gmail.com>
|
|
7
|
+
License: Apache License
|
|
8
|
+
Version 2.0, January 2004
|
|
9
|
+
http://www.apache.org/licenses/
|
|
10
|
+
|
|
11
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
12
|
+
|
|
13
|
+
1. Definitions.
|
|
14
|
+
|
|
15
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
16
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
17
|
+
|
|
18
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
19
|
+
the copyright owner that is granting the License.
|
|
20
|
+
|
|
21
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
22
|
+
other entities that control, are controlled by, or are under common
|
|
23
|
+
control with that entity. For the purposes of this definition,
|
|
24
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
25
|
+
direction or management of such entity, whether by contract or
|
|
26
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
27
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
28
|
+
|
|
29
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
30
|
+
exercising permissions granted by this License.
|
|
31
|
+
|
|
32
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
33
|
+
including but not limited to software source code, documentation
|
|
34
|
+
source, and configuration files.
|
|
35
|
+
|
|
36
|
+
"Object" form shall mean any form resulting from mechanical
|
|
37
|
+
transformation or translation of a Source form, including but
|
|
38
|
+
not limited to compiled object code, generated documentation,
|
|
39
|
+
and conversions to other media types.
|
|
40
|
+
|
|
41
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
42
|
+
Object form, made available under the License, as indicated by a
|
|
43
|
+
copyright notice that is included in or attached to the work
|
|
44
|
+
(an example is provided in the Appendix below).
|
|
45
|
+
|
|
46
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
47
|
+
form, that is based on (or derived from) the Work and for which the
|
|
48
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
49
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
50
|
+
of this License, Derivative Works shall not include works that remain
|
|
51
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
52
|
+
the Work and Derivative Works thereof.
|
|
53
|
+
|
|
54
|
+
"Contribution" shall mean any work of authorship, including
|
|
55
|
+
the original version of the Work and any modifications or additions
|
|
56
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
57
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
58
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
59
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
60
|
+
means any form of electronic, verbal, or written communication sent
|
|
61
|
+
to the Licensor or its representatives, including but not limited to
|
|
62
|
+
communication on electronic mailing lists, source code control systems,
|
|
63
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
64
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
65
|
+
excluding communication that is conspicuously marked or otherwise
|
|
66
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
67
|
+
|
|
68
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
69
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
70
|
+
subsequently incorporated within the Work.
|
|
71
|
+
|
|
72
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
73
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
74
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
75
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
76
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
77
|
+
Work and such Derivative Works in Source or Object form.
|
|
78
|
+
|
|
79
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
80
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
81
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
82
|
+
(except as stated in this section) patent license to make, have made,
|
|
83
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
84
|
+
where such license applies only to those patent claims licensable
|
|
85
|
+
by such Contributor that are necessarily infringed by their
|
|
86
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
87
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
88
|
+
institute patent litigation against any entity (including a
|
|
89
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
90
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
91
|
+
or contributory patent infringement, then any patent licenses
|
|
92
|
+
granted to You under this License for that Work shall terminate
|
|
93
|
+
as of the date such litigation is filed.
|
|
94
|
+
|
|
95
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
96
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
97
|
+
modifications, and in Source or Object form, provided that You
|
|
98
|
+
meet the following conditions:
|
|
99
|
+
|
|
100
|
+
(a) You must give any other recipients of the Work or
|
|
101
|
+
Derivative Works a copy of this License; and
|
|
102
|
+
|
|
103
|
+
(b) You must cause any modified files to carry prominent notices
|
|
104
|
+
stating that You changed the files; and
|
|
105
|
+
|
|
106
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
107
|
+
that You distribute, all copyright, patent, trademark, and
|
|
108
|
+
attribution notices from the Source form of the Work,
|
|
109
|
+
excluding those notices that do not pertain to any part of
|
|
110
|
+
the Derivative Works; and
|
|
111
|
+
|
|
112
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
113
|
+
distribution, then any Derivative Works that You distribute must
|
|
114
|
+
include a readable copy of the attribution notices contained
|
|
115
|
+
within such NOTICE file, excluding those notices that do not
|
|
116
|
+
pertain to any part of the Derivative Works, in at least one
|
|
117
|
+
of the following places: within a NOTICE text file distributed
|
|
118
|
+
as part of the Derivative Works; within the Source form or
|
|
119
|
+
documentation, if provided along with the Derivative Works; or,
|
|
120
|
+
within a display generated by the Derivative Works, if and
|
|
121
|
+
wherever such third-party notices normally appear. The contents
|
|
122
|
+
of the NOTICE file are for informational purposes only and
|
|
123
|
+
do not modify the License. You may add Your own attribution
|
|
124
|
+
notices within Derivative Works that You distribute, alongside
|
|
125
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
126
|
+
that such additional attribution notices cannot be construed
|
|
127
|
+
as modifying the License.
|
|
128
|
+
|
|
129
|
+
You may add Your own copyright statement to Your modifications and
|
|
130
|
+
may provide additional or different license terms and conditions
|
|
131
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
132
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
133
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
134
|
+
the conditions stated in this License.
|
|
135
|
+
|
|
136
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
137
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
138
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
139
|
+
this License, without any additional terms or conditions.
|
|
140
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
141
|
+
the terms of any separate license agreement you may have executed
|
|
142
|
+
with Licensor regarding such Contributions.
|
|
143
|
+
|
|
144
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
145
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
146
|
+
except as required for reasonable and customary use in describing the
|
|
147
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
148
|
+
|
|
149
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
150
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
151
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
152
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
153
|
+
implied, including, without limitation, any warranties or conditions
|
|
154
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
155
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
156
|
+
appropriateness of using or redistributing the Work and assume any
|
|
157
|
+
risks associated with Your exercise of permissions under this License.
|
|
158
|
+
|
|
159
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
160
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
161
|
+
unless required by applicable law (such as deliberate and grossly
|
|
162
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
163
|
+
liable to You for damages, including any direct, indirect, special,
|
|
164
|
+
incidental, or consequential damages of any character arising as a
|
|
165
|
+
result of this License or out of the use or inability to use the
|
|
166
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
167
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
168
|
+
other commercial damages or losses), even if such Contributor
|
|
169
|
+
has been advised of the possibility of such damages.
|
|
170
|
+
|
|
171
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
172
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
173
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
174
|
+
or other liability obligations and/or rights consistent with this
|
|
175
|
+
License. However, in accepting such obligations, You may act only
|
|
176
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
177
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
178
|
+
defend, and hold each Contributor harmless for any liability
|
|
179
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
180
|
+
of your accepting any such warranty or additional liability.
|
|
181
|
+
|
|
182
|
+
END OF TERMS AND CONDITIONS
|
|
183
|
+
|
|
184
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
185
|
+
|
|
186
|
+
To apply the Apache License to your work, attach the following
|
|
187
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
188
|
+
replaced with your own identifying information. (Don't include
|
|
189
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
190
|
+
comment syntax for the file format. We also recommend that a
|
|
191
|
+
file or class name and description of purpose be included on the
|
|
192
|
+
same "printed page" as the copyright notice for easier
|
|
193
|
+
identification within third-party archives.
|
|
194
|
+
|
|
195
|
+
Copyright [yyyy] [name of copyright owner]
|
|
196
|
+
|
|
197
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
198
|
+
you may not use this file except in compliance with the License.
|
|
199
|
+
You may obtain a copy of the License at
|
|
200
|
+
|
|
201
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
202
|
+
|
|
203
|
+
Unless required by applicable law or agreed to in writing, software
|
|
204
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
205
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
206
|
+
See the License for the specific language governing permissions and
|
|
207
|
+
limitations under the License.
|
|
208
|
+
|
|
209
|
+
Project-URL: Homepage, https://github.com/yeshu999/effspm
|
|
210
|
+
Project-URL: Source, https://github.com/yeshu999/effspm
|
|
211
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
212
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
214
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
215
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
216
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
217
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
218
|
+
Classifier: Programming Language :: C++
|
|
219
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
220
|
+
Classifier: Operating System :: OS Independent
|
|
221
|
+
Requires-Python: >=3.7
|
|
222
|
+
Description-Content-Type: text/markdown
|
|
223
|
+
License-File: LICENSE
|
|
224
|
+
Requires-Dist: pybind11>=2.6
|
|
225
|
+
Dynamic: author
|
|
226
|
+
Dynamic: license-file
|
|
227
|
+
|
|
228
|
+
# effspm
|
|
229
|
+
|
|
230
|
+
**Efficient Sequential Pattern Mining via Prefix‑Projection**
|
|
231
|
+
|
|
232
|
+
This library provides a Python interface to mine sequential patterns using the prefix‑projection algorithm, implemented in C++ for performance and exposed via pybind11.
|
|
233
|
+
|
|
234
|
+
## Installation
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
pip install effspm
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
effspm/__init__.py,sha256=P2BlW2-xTmfF2KK0ZMaTbw_yHpVX-Ue0wmhBL1FMIGA,90
|
|
2
|
+
effspm/_core.cpp,sha256=S6UsUcl0HQLMQUTy2tMJxcrbLGJo8tjkLskyHqESYyI,3675
|
|
3
|
+
effspm/_effspm.cpp,sha256=3paU981ioLFGYG4XtQLcWPXCoU-L1AMWrKvU-OU2WQU,5029
|
|
4
|
+
effspm/_effspm.cpython-313-darwin.so,sha256=DGzTt51WtrKnmRUPperj0b1pJ560pUfhuEjcHJEl1oc,575600
|
|
5
|
+
effspm/freq_miner.cpp,sha256=9K-nO_c-vVzbFlmh511vmvypA2fu1TXpiJhyx03owDU,4642
|
|
6
|
+
effspm/freq_miner.hpp,sha256=jA-ZCT12Z0YNjLoAiY9sniFTP6g-ITTDuWtlOdHXkMQ,744
|
|
7
|
+
effspm/load_inst.cpp,sha256=804fvkfdtYqFMP9Jla6dM2romWWPJmSeCwLm0wEZE5M,4517
|
|
8
|
+
effspm/load_inst.hpp,sha256=cR-iZG95mUN62ZLCnPNQsKUINtkwhUzMTLlH81wmyt0,906
|
|
9
|
+
effspm/main.cpp,sha256=aMyPwuTn5dPIlLAZ_XfWL8Z6cXfQS7EaJ0tEQPqpA8I,2558
|
|
10
|
+
effspm/utility.cpp,sha256=luWwBNy7OVWRmam9gz2RjhtrRmx6c37oOobFJaDWqcA,1403
|
|
11
|
+
effspm/utility.hpp,sha256=Y_MQVk9AmJWjguKyuyk0LraTi_6VzZFg0StsmVOCkNc,744
|
|
12
|
+
effspm/btminer/src/build_mdd.cpp,sha256=LWfH_23cTExfOeK3evO46C8Di2_hmu7uCbmutOxj4Fw,1727
|
|
13
|
+
effspm/btminer/src/build_mdd.hpp,sha256=CvowY9TxxnMh3_bIy0HZ9eZmnCm45z5A6Xz5hxHcwfg,567
|
|
14
|
+
effspm/btminer/src/freq_miner.cpp,sha256=D1ofcP9_6QFskmMcvnUZ-Ck5CZWRsFrFw0yyArpsjYs,6476
|
|
15
|
+
effspm/btminer/src/freq_miner.hpp,sha256=x-c7BpMdNqYiDFM49I7VDJXeb1tIruTOeD-3MXJ2g0A,626
|
|
16
|
+
effspm/btminer/src/load_inst.cpp,sha256=nSRwJf3B5ueQeT3vgHGGo-eStRWIK1Vhzsr4iVBC0bU,5194
|
|
17
|
+
effspm/btminer/src/load_inst.hpp,sha256=yxKcglYf3Zbi0BWqQ_BFaTTKy1rFC9FGOo2urO76YEE,460
|
|
18
|
+
effspm/btminer/src/main.cpp,sha256=Jj7pUpkvoAkY2SlsKHc8MImDP-RlOIAyqSxEz1rmd5g,3059
|
|
19
|
+
effspm/btminer/src/utility.cpp,sha256=LnxXQsV4t02bFHASX6MZvpDn8J1mXPyvuExcBEk63gM,1593
|
|
20
|
+
effspm/btminer/src/utility.hpp,sha256=fZIJVq1WFXFmcgPvA9akdydilTQBT3I69WMCiJhTi_8,1093
|
|
21
|
+
effspm-0.1.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
22
|
+
effspm-0.1.9.dist-info/METADATA,sha256=vdScIwPIzNEZessmkHIKuwWQBLkd8LjSKXYU---5Ag8,14227
|
|
23
|
+
effspm-0.1.9.dist-info/WHEEL,sha256=ndSQSyKfEb4-QYoSqR9pmJeIy6hpNbwBzv_4vZGKDVo,115
|
|
24
|
+
effspm-0.1.9.dist-info/top_level.txt,sha256=2O-AuI0nw0pDmJMo2jzM1wvV2rj48AmkjskkAnsuuQk,7
|
|
25
|
+
effspm-0.1.9.dist-info/RECORD,,
|
|
Binary file
|
effspm-0.1.6.dist-info/METADATA
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: effspm
|
|
3
|
-
Version: 0.1.6
|
|
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
|
effspm-0.1.6.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
effspm/utility.hpp,sha256=Y_MQVk9AmJWjguKyuyk0LraTi_6VzZFg0StsmVOCkNc,744
|
|
2
|
-
effspm/_core.cpython-313-darwin.so,sha256=147sIggZxYEJaOK9DLopbwxiB6WwJLSUKTnxDj-_7yQ,480176
|
|
3
|
-
effspm/_core.cpp,sha256=S6UsUcl0HQLMQUTy2tMJxcrbLGJo8tjkLskyHqESYyI,3675
|
|
4
|
-
effspm/load_inst.hpp,sha256=cR-iZG95mUN62ZLCnPNQsKUINtkwhUzMTLlH81wmyt0,906
|
|
5
|
-
effspm/__init__.py,sha256=3fTJ432t0_vjUMnkw4d8I3Jgots4YKVHWnDSHKs_qb4,68
|
|
6
|
-
effspm/freq_miner.cpp,sha256=9K-nO_c-vVzbFlmh511vmvypA2fu1TXpiJhyx03owDU,4642
|
|
7
|
-
effspm/load_inst.cpp,sha256=804fvkfdtYqFMP9Jla6dM2romWWPJmSeCwLm0wEZE5M,4517
|
|
8
|
-
effspm/freq_miner.hpp,sha256=jA-ZCT12Z0YNjLoAiY9sniFTP6g-ITTDuWtlOdHXkMQ,744
|
|
9
|
-
effspm/utility.cpp,sha256=luWwBNy7OVWRmam9gz2RjhtrRmx6c37oOobFJaDWqcA,1403
|
|
10
|
-
effspm-0.1.6.dist-info/RECORD,,
|
|
11
|
-
effspm-0.1.6.dist-info/WHEEL,sha256=7D3G_jWHhJAoFy5YHKW8Aevt7D0Y-GToB74dVA7ZWh0,142
|
|
12
|
-
effspm-0.1.6.dist-info/top_level.txt,sha256=2O-AuI0nw0pDmJMo2jzM1wvV2rj48AmkjskkAnsuuQk,7
|
|
13
|
-
effspm-0.1.6.dist-info/METADATA,sha256=XwJN4eG2oOWfowNsNQhKxcWRfV7zjiHRWwyDYixwpUk,1311
|
|
14
|
-
effspm-0.1.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
File without changes
|
|
File without changes
|