interpret_community.explanation.serialization module¶
Defines the save and load explanation methods and helpers for serialization.
- interpret_community.explanation.serialization.load_explanation(path)¶
Deserialize the explanation.
- Parameters
path (str) – The path to the directory in which the explanation will be saved. By default, must be a new directory to avoid overwriting any previous explanations. Set exist_ok to True to overrule this behavior.
- Returns
The deserialized explanation.
- Return type
Explanation
- interpret_community.explanation.serialization.save_explanation(explanation, path, exist_ok=False)¶
Serialize the explanation.
- Parameters
explanation (Explanation) – The Explanation to be serialized.
path (str) – The path to the directory in which the explanation will be saved. By default, must be a new directory to avoid overwriting any previous explanations. Set exist_ok to True to overrule this behavior.
exist_ok (bool) – If False (default), the path provided by the user must not already exist and will be created by this function. If True, a prexisting path may be passed. Any preexisting files whose names match those of the files that make up the explanation will be overwritten.