peal.entrypoints.run_explainer

Explain a trained predictor with a stand-alone explainer run.

Builds the explainer that explainer_type in the config selects through peal.explainers.explainer_factory.get_explainer (chiefly the counterfactual explainer in peal/explainers/counterfactual_explainer.py), runs it over the dataset it is configured with, has the configured teacher annotate the explanations and renders the interpretations.

Invocation:

python run_explainer.py --config <explainer.yaml> \
    [--oracle_path <model.cpl>] [--confounder_oracle_path <model.cpl>]

Explainer configs live in configs/*/explainers. The explanations, collages and interpretation figures are written into the config’s explanations_dir. The two oracle paths are forwarded to explainer.run and the models are loaded afterwards, but the evaluation against them that the trailing branches announce was never implemented: the loaded oracles are unused.

Functions

main

Build the explainer from --config and run, annotate and visualise.