c++shogun

How to save/load trained model in Shogun?


How to save/load trained model in Shogun? Didn't find in docs.

https://www.shogun-toolbox.org/examples/latest/quickstart/interfaces.html


Solution

  • depends on what version you are using. in case release here's an example: https://github.com/shogun-toolbox/shogun/blob/master/examples/undocumented/libshogun/library_serialization.cpp

    if you are using develop then simply use

    ...
    auto jsonSerilizer = std::make_shared<io::JsonSerializer>();
    obj.serialize(jsonSerilizer);
    ...