effspm 0.3.1__cp310-cp310-macosx_10_9_x86_64.whl → 0.3.2__cp310-cp310-macosx_10_9_x86_64.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/_effspm.cpp +83 -61
- effspm/_effspm.cpython-310-darwin.so +0 -0
- {effspm-0.3.1.dist-info → effspm-0.3.2.dist-info}/METADATA +1 -1
- {effspm-0.3.1.dist-info → effspm-0.3.2.dist-info}/RECORD +7 -7
- {effspm-0.3.1.dist-info → effspm-0.3.2.dist-info}/WHEEL +0 -0
- {effspm-0.3.1.dist-info → effspm-0.3.2.dist-info}/licenses/LICENSE +0 -0
- {effspm-0.3.1.dist-info → effspm-0.3.2.dist-info}/top_level.txt +0 -0
effspm/_effspm.cpp
CHANGED
|
@@ -163,73 +163,95 @@ PYBIND11_MODULE(_effspm, m) {
|
|
|
163
163
|
// ─────────────────────────────────────────────────────────────
|
|
164
164
|
// BTMiner (always uses professor's Load_instance)
|
|
165
165
|
// ─────────────────────────────────────────────────────────────
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
166
|
+
// ─────────────────────────────────────────────────────────────
|
|
167
|
+
// BTMiner (always uses professor's Load_instance)
|
|
168
|
+
// ─────────────────────────────────────────────────────────────
|
|
169
|
+
m.def("BTMiner",
|
|
170
|
+
[](py::object data,
|
|
171
|
+
double minsup,
|
|
172
|
+
unsigned int time_limit,
|
|
173
|
+
bool preproc,
|
|
174
|
+
bool use_dic,
|
|
175
|
+
bool verbose,
|
|
176
|
+
const std::string &out_file)
|
|
177
|
+
{
|
|
178
|
+
// 1) Configure professor globals
|
|
179
|
+
btminer::time_limit = static_cast<int>(time_limit);
|
|
180
|
+
btminer::pre_pro = preproc;
|
|
181
|
+
btminer::use_dic = use_dic;
|
|
182
|
+
btminer::b_disp = verbose;
|
|
183
|
+
btminer::b_write = !out_file.empty();
|
|
184
|
+
btminer::out_file = out_file;
|
|
185
|
+
btminer::N_mult = 1;
|
|
186
|
+
btminer::M_mult = 1;
|
|
187
|
+
btminer::just_build = false;
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
// 2) HARD RESET of *known* global state for BTMiner
|
|
190
|
+
// (Only touch what we know exists in btminer namespace)
|
|
191
|
+
btminer::ClearCollected(); // clear collected patterns
|
|
192
|
+
btminer::Tree.clear(); // clear MDD tree
|
|
193
|
+
btminer::DFS.clear(); // clear DFS patterns
|
|
191
194
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
tmp.path = write_temp_seq_file(seqs);
|
|
199
|
-
path = tmp.path;
|
|
200
|
-
}
|
|
195
|
+
btminer::M = 0;
|
|
196
|
+
btminer::L = 0;
|
|
197
|
+
btminer::N = 0;
|
|
198
|
+
btminer::theta = 0;
|
|
199
|
+
btminer::E = 0;
|
|
200
|
+
btminer::num_patt = 0; // reset pattern counter if defined
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<< " minsup=" << minsup
|
|
205
|
-
<< " preproc=" << preproc
|
|
206
|
-
<< " use_dic=" << use_dic
|
|
207
|
-
<< std::endl;
|
|
208
|
-
}
|
|
202
|
+
// NOTE: we do NOT reinsert root here; btminer::Load_instance()
|
|
203
|
+
// is responsible for calling Tree.emplace_back(0,0,0) as needed.
|
|
209
204
|
|
|
210
|
-
|
|
211
|
-
throw std::runtime_error("BTMiner: failed to load instance from: " + path);
|
|
212
|
-
}
|
|
205
|
+
btminer::start_time = std::clock();
|
|
213
206
|
|
|
214
|
-
|
|
207
|
+
// 3) Handle input (path or list-of-lists)
|
|
208
|
+
TempFile tmp;
|
|
209
|
+
std::string path;
|
|
210
|
+
|
|
211
|
+
if (py::isinstance<py::str>(data)) {
|
|
212
|
+
// File path: use directly
|
|
213
|
+
path = data.cast<std::string>();
|
|
214
|
+
} else {
|
|
215
|
+
// Python list → write to a temp file in professor’s format
|
|
216
|
+
auto seqs = data.cast<std::vector<std::vector<int>>>();
|
|
217
|
+
tmp.path = write_temp_seq_file(seqs);
|
|
218
|
+
path = tmp.path;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (verbose) {
|
|
222
|
+
std::cerr << "[BTMiner] path=" << path
|
|
223
|
+
<< " minsup=" << minsup
|
|
224
|
+
<< " preproc=" << preproc
|
|
225
|
+
<< " use_dic=" << use_dic
|
|
226
|
+
<< std::endl;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// 4) Build MDD + run miner
|
|
230
|
+
if (!btminer::Load_instance(path, minsup)) {
|
|
231
|
+
throw std::runtime_error("BTMiner: failed to load instance from: " + path);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
btminer::Freq_miner();
|
|
235
|
+
|
|
236
|
+
// 5) Return results
|
|
237
|
+
py::dict out;
|
|
238
|
+
out["patterns"] = btminer::GetCollected();
|
|
239
|
+
out["num_patterns"] = btminer::num_patt;
|
|
240
|
+
out["time"] = btminer::give_time(std::clock() - btminer::start_time);
|
|
241
|
+
out["N"] = btminer::N;
|
|
242
|
+
out["L"] = btminer::L;
|
|
243
|
+
out["theta"] = btminer::theta;
|
|
244
|
+
return out;
|
|
245
|
+
},
|
|
246
|
+
py::arg("data"),
|
|
247
|
+
py::arg("minsup") = 0.01,
|
|
248
|
+
py::arg("time_limit") = 36000,
|
|
249
|
+
py::arg("preproc") = false,
|
|
250
|
+
py::arg("use_dic") = false,
|
|
251
|
+
py::arg("verbose") = false,
|
|
252
|
+
py::arg("out_file") = ""
|
|
253
|
+
);
|
|
215
254
|
|
|
216
|
-
py::dict out;
|
|
217
|
-
out["patterns"] = btminer::GetCollected();
|
|
218
|
-
out["num_patterns"] = btminer::num_patt;
|
|
219
|
-
out["time"] = btminer::give_time(std::clock() - btminer::start_time);
|
|
220
|
-
out["N"] = btminer::N;
|
|
221
|
-
out["L"] = btminer::L;
|
|
222
|
-
out["theta"] = btminer::theta;
|
|
223
|
-
return out;
|
|
224
|
-
},
|
|
225
|
-
py::arg("data"),
|
|
226
|
-
py::arg("minsup") = 0.01,
|
|
227
|
-
py::arg("time_limit") = 36000,
|
|
228
|
-
py::arg("preproc") = false,
|
|
229
|
-
py::arg("use_dic") = false,
|
|
230
|
-
py::arg("verbose") = false,
|
|
231
|
-
py::arg("out_file") = ""
|
|
232
|
-
);
|
|
233
255
|
|
|
234
256
|
// ─────────────────────────────────────────────────────────────
|
|
235
257
|
// HTMiner (works on files; we use a temp file for in-memory data)
|
|
Binary file
|
|
@@ -2,9 +2,9 @@ effspm/utility.hpp,sha256=Y_MQVk9AmJWjguKyuyk0LraTi_6VzZFg0StsmVOCkNc,744
|
|
|
2
2
|
effspm/_core.cpp,sha256=S6UsUcl0HQLMQUTy2tMJxcrbLGJo8tjkLskyHqESYyI,3675
|
|
3
3
|
effspm/load_inst.hpp,sha256=VF0o_Ur-mO5xhdWWn1KHrFLu9_bTbd8wcURCVF0A0dM,907
|
|
4
4
|
effspm/__init__.py,sha256=_BkZ8cFlB_l1haxTzxJMgFHhO6LEmF3pIY-nmPTPMj8,246
|
|
5
|
-
effspm/_effspm.cpython-310-darwin.so,sha256=
|
|
5
|
+
effspm/_effspm.cpython-310-darwin.so,sha256=SPf96drbh__VEmH5O88MmZP-nVMzVyKWYycqQStLH1Q,561040
|
|
6
6
|
effspm/freq_miner.cpp,sha256=9K-nO_c-vVzbFlmh511vmvypA2fu1TXpiJhyx03owDU,4642
|
|
7
|
-
effspm/_effspm.cpp,sha256=
|
|
7
|
+
effspm/_effspm.cpp,sha256=JC4CPqjV4nyyHRv7EhQPQvXOb7Pj0Ge8Prxo0WCsCAg,47255
|
|
8
8
|
effspm/load_inst.cpp,sha256=h9pjtvRCIrtqIAt8W1r8SxOb1YViW1pCR52tbxbPdh0,4591
|
|
9
9
|
effspm/freq_miner.hpp,sha256=XDhydwUFmute6slWwZcFuiBjGZs4Kv5-UvAmcI_IMwI,786
|
|
10
10
|
effspm/utility.cpp,sha256=luWwBNy7OVWRmam9gz2RjhtrRmx6c37oOobFJaDWqcA,1403
|
|
@@ -53,8 +53,8 @@ effspm/btminer/src/freq_miner.hpp,sha256=sS2CGdNT0zSGtSz0evZZlUkuiKyWlSvrR3-M2YX
|
|
|
53
53
|
effspm/btminer/src/build_mdd.hpp,sha256=p0pEcNZMD-WqV0UB1WtOn-Soe0105gEL071Ht5okgJM,627
|
|
54
54
|
effspm/btminer/src/utility.cpp,sha256=YmwdNPCUHFjydwrUAyBLEkFqUecyg7r4HbPdgoD-j3s,1194
|
|
55
55
|
effspm/btminer/src/main.cpp,sha256=Jh9M5nsZUL3i-iENn7Jh--TOY0F5dnu6CvqZ7udWU3A,2678
|
|
56
|
-
effspm-0.3.
|
|
57
|
-
effspm-0.3.
|
|
58
|
-
effspm-0.3.
|
|
59
|
-
effspm-0.3.
|
|
60
|
-
effspm-0.3.
|
|
56
|
+
effspm-0.3.2.dist-info/RECORD,,
|
|
57
|
+
effspm-0.3.2.dist-info/WHEEL,sha256=SQ0RWtyPnHPLqVWH_Tib5lCSw2Mp1jiRR5LTh7CkGzY,110
|
|
58
|
+
effspm-0.3.2.dist-info/top_level.txt,sha256=2O-AuI0nw0pDmJMo2jzM1wvV2rj48AmkjskkAnsuuQk,7
|
|
59
|
+
effspm-0.3.2.dist-info/METADATA,sha256=JfNcmGZRF3qJbQKDXloeRbOHMw0R8tQNb-80p9KNjW0,14227
|
|
60
|
+
effspm-0.3.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
File without changes
|
|
File without changes
|
|
File without changes
|