Skip to content

Persistence

Save and load optimization results and trained surrogate models.

Result Persistence

surrox.save_result(result, path)

Serialize a SurroxResult to a JSON file.

Parameters:

Name Type Description Default
result SurroxResult

The result to save.

required
path Path

Destination file path. Parent directories are created automatically.

required

surrox.load_result(path)

Deserialize a SurroxResult from a JSON file.

Parameters:

Name Type Description Default
path Path

Path to the JSON file.

required

Returns:

Type Description
SurroxResult

The deserialized result.

Surrogate Persistence

Trained surrogates (models, conformal calibration, metadata) can be saved and loaded via SurrogateManager.save() and SurrogateManager.load(). See Surrogate API for details.