Metadata-Version: 2.4
Name: recoverability
Version: 0.1.0
Summary: Compute recoverability dimensions (rho_variance and rho_worst) for arbitrary model functions.
Author: Manny
License: MIT
Project-URL: Homepage, https://github.com/EmanuelTeklu/recoverability-theory
Project-URL: Repository, https://github.com/EmanuelTeklu/recoverability-theory
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.11
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"

# recoverability

`recoverability` computes recoverability metrics for model mechanisms.

The package currently provides:

- `rho_variance(model_fn, X)`
- `rho_worst(model_fn, X)`
- `rho_report(model_fn, X)`
- Example mechanisms such as `linear_sum` and `product_mechanism`

## Installation

```bash
pip install recoverability
```

## Quick Start

```python
import numpy as np

from recoverability import rho_worst

X = np.random.default_rng(0).uniform(0.0, 1.0, size=(300, 3))

def model_fn(x: np.ndarray) -> np.ndarray:
    return x[:, 0] + x[:, 1] * x[:, 2]

result = rho_worst(model_fn, X)
print(result["rho_worst"])
```

## Development

```bash
python3 -m pytest tests/ -v
python3 -m build
```
