Metadata-Version: 2.4
Name: shap-result-analysis
Version: 0.2.1
Summary: A survival-analysis result pipeline built around SHAP recommendations
License-Expression: MIT
Keywords: shap,survival-analysis,cox-regression,model-evaluation
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Requires-Dist: pandas>=1.5
Requires-Dist: scipy>=1.9
Requires-Dist: scikit-learn>=1.2
Requires-Dist: scikit-survival>=0.22
Requires-Dist: lifelines>=0.27
Requires-Dist: matplotlib>=3.6
Requires-Dist: patsy>=0.5
Requires-Dist: shap-recommender>=0.5.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# shap-result-analysis

`shap-result-analysis` runs a survival-model result pipeline around
recommendations produced by `shap-recommender`. It supports exclusion,
non-linearity and interaction variants, independent confirmation, comparator
models, sequential ablation, calibration, proportional-hazards checks and
subgroup reporting.

## Installation

```bash
pip install shap-result-analysis
```

## Input files

The pipeline expects a data directory containing `feature_spec.json` and the
following tab-separated files:

- `X_disc_model.tsv` and `y_disc.tsv`
- `X_conf_model.tsv` and `y_conf.tsv`
- `X_train_model.tsv` and `y_train.tsv`
- `X_test_model.tsv` and `y_test.tsv`
- `X_train_original.tsv` and `X_test_original.tsv`

Each outcome file must contain `event` and `time` columns. By default the data
directory is `rebuttal_data`, matching the source pipeline.

## Command line

Run the full pipeline from the directory containing the data directory:

```bash
shap-result-analysis
```

Optional stages can be skipped:

```bash
shap-result-analysis --skip-validation --skip-comparators --skip-ablation
```

## Library use

```python
from result_analysis import main

main(
    run_validation=True,
    run_comparators=True,
    run_ablation=True,
    run_dose_response=True,
    run_margin=False,
)
```

## License

MIT

