Metadata-Version: 2.4
Name: flopsearch
Version: 0.1.1
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Summary: Python package providing an implementation of the FLOP causal discovery algorithm for linear additive noise models
Keywords: causal discovery,DAGs,Bayesian networks,structure learning
Author: Sebastian Weichwald, Leonard Henckel
Author-email: Marcel Wienöbst <marcel.wienoebst@gmx.de>
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# flopsearch

Python package providing an implementation of the FLOP causal discovery algorithm for linear additive noise models.

## Installation
flopsearch can be installed via pip:

```bash
pip install flopsearch
```

## Citing FLOP
If you use FLOP in your scientific work, please cite this paper:
```bibtex
@article{cifly2025,
  author  = {Marcel Wien{"{o}}bst and Leonard Henckel and Sebastian Weichwald},
  title   = {{Embracing Discrete Search: A Reasonable Approach to Causal Structure Learning}},
  journal = {{arXiv preprint arXiv:2510.04970}},
  year    = {2025}
}
```

## Example
A simple example run of the FLOP algorithm provided by flopsearch.

``` py
import flopsearch
import numpy as np
from scipy import linalg

p = 10
W = np.diag(np.ones(p - 1), 1)
X = np.random.randn(10000, p).dot(linalg.inv(np.eye(p) - W))
X_std = (X - np.mean(X, axis=0)) / np.std(X, axis=0)
flopsearch.flop(X_std, 2.0, restarts=20)
```

