pub struct Serializer;
Expand description
Helper struct to serialize and deserialize LibLinearModel instances.
Implementations§
Source§impl Serializer
impl Serializer
Sourcepub fn load_model(
path_to_serialized_model: &str,
) -> Result<impl LibLinearModel, Error>
pub fn load_model( path_to_serialized_model: &str, ) -> Result<impl LibLinearModel, Error>
Loads a model from disk.
The loaded model will have no associated LibLinearProblem instance. With the exception of the solver type, all parameters in the associated LibLinearParameter instance will be reset to their default values.
Sourcepub fn save_model(
path_to_serialized_model: &str,
model: &impl LibLinearModel,
) -> Result<(), Error>
pub fn save_model( path_to_serialized_model: &str, model: &impl LibLinearModel, ) -> Result<(), Error>
Saves a model to disk.
Convenience method that calls save_to_disk
on the model instance.
Auto Trait Implementations§
impl Freeze for Serializer
impl RefUnwindSafe for Serializer
impl Send for Serializer
impl Sync for Serializer
impl Unpin for Serializer
impl UnwindSafe for Serializer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more