Runner¶
- class xaicompare.runner.XAICompareRunner(model, x_test, y_test: Sequence | None = None, raw_text: Sequence | None = None, class_names: Sequence[str] | None = None, run_dir: str = 'runs/_latest', config: Dict[str, Any] | None = None, save_model: bool = True, *, model_type: str = 'sklearn', xai_methods: List[str] | None = None, top_k_local: int = 15)[source]¶
Bases:
objectOrchestrates a full ‘publish run’:
Registry autodiscovery
Model wrapping via registry
Predictions + top-k probabilities
XAI global + local explanations for one or more methods
Text index
Artifact persistence to a run directory
Usage:
runner = XAICompareRunner( model=my_model, x_test=x_test, y_test=y_test, raw_text=texts, class_names=class_names, run_dir="runs/_latest", config={"rows_limit_global": 200, "rows_limit_local": 200}, save_model=True, model_type="sklearn", xai_methods=["shap_tree"], top_k_local=15, ) runner.run()