[source]

Persistent Model#

The Persistent Model meta-estimator wraps a Persistable learner with additional functionality for saving and loading the model. It uses Persister objects to interface with various storage backends such as the Filesystem or Redis.

Interfaces: Estimator, Learner, Probabilistic

Data Type Compatibility: Depends on base learner

Parameters#

# Param Default Type Description
1 base Learner An instance of a persistable estimator.
2 persister Persister The persister object used interface with the storage medium.

Additional Methods#

Save the persistent model to storage:

public save() : void

Load the persistent model from storage given a persister:

public static load(Persister $persister) : self

Example#

use Rubix\ML\PersistentModel;
use Rubix\ML\Persisters\Filesystem;

$estimator = PersistentModel::load(new Filesystem('example.model'));

// Do something ...

$estimator->save();