cleverly.load#

cleverly.load(path: str | Path) → Any[source]#

Load a complete result from a trusted joblib artifact.

Never load a file from an untrusted source: joblib deserialization can execute arbitrary Python code.

Parameters:
pathstr or Path

File written by save().

Returns:
TMLEResult or LongitudinalResult

The stored result, with the artifacts the file carried.

Raises:
TypeError

When the file holds no fitted causal result.

ValueError

When the file holds data after the result.

Warns:
VersionMismatchWarning

When a different cleverly version wrote the file, or when the file records no version. The result then loads as saved, with no migration.