Metadata-Version: 2.1
Name: BayesPermus
Version: 0.0.1
Summary: Bayesian inference of algorithm performance using permutation models.
Home-page: https://github.com/ml-opt/BayesPermus
Author: Jairo Rojas-Delgado
Author-email: jrojasdelgado@bcamath.org
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/ml-opt/BayesPermus/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

#BayesPermus

Bayesian inference of algorithm performance using permutation models.

## Installation

```
	pip install BayesPermus
```

## Usage

1. Prepare permutation data:

```python
permus = np.array([[1,2,3], [1,3,2]])
```

2. Obtain the marginal probabilities:

```python
from BayesPermus.models.BradleyTerry import BradleyTerry

# BT Dirichlet hyper-priors
 dirichlet_alpha_bt = num_algorithms * [1]


bradleyTerry = BradleyTerry(dirichlet_alpha_bt, num_samples=1000)

# Calculate the marginal probabilities
probs = bradleyTerry.calculate_top_ranking_probs(permus)

```

## Additional available marginals

* Probability of an algorithm to be in the first position: `model.calculate_top_ranking_probs(...)`.
* Probability of an algorithm to outperform another: `model.calculate_better_than_probs(...)`.
* Probability of an algorithm to be in the top-k ranking: `model.calculate_top_k_probs(...)`.

