MCPcopy Create free account
hub / github.com/bab2min/tomotopy / save

Method save

src/python/handler/py_LDA.cpp:413–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413void LDAModelObject::save(const std::string& filename, const std::vector<uint8_t>& extraData, bool full)
414{
415 auto* inst = getInst<tomoto::ILDAModel>();
416 if (!isPrepared)
417 {
418 inst->prepare(true, minWordCnt, minWordDf, removeTopWord);
419 isPrepared = true;
420 }
421 ofstream str{ filename, ios_base::binary };
422 if (!str) throw py::OSError{ std::string("cannot open file '") + filename + std::string("'") };
423
424 inst->saveModel(str, !!full, &extraData);
425}
426
427py::UniqueObj LDAModelObject::saves(const std::vector<uint8_t>& extraData, bool full)
428{

Callers

nothing calls this directly

Calls 2

saveModelMethod · 0.80
prepareMethod · 0.45

Tested by

no test coverage detected