flopsearch 0.1.3__cp313-cp313-musllinux_1_2_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flopsearch might be problematic. Click here for more details.
- flopsearch/__init__.py +5 -0
- flopsearch/__init__.pyi +26 -0
- flopsearch/flopsearch.cpython-313-i386-linux-musl.so +0 -0
- flopsearch/py.typed +0 -0
- flopsearch-0.1.3.dist-info/METADATA +50 -0
- flopsearch-0.1.3.dist-info/RECORD +8 -0
- flopsearch-0.1.3.dist-info/WHEEL +4 -0
- flopsearch.libs/libgcc_s-27e5a392.so.1 +0 -0
flopsearch/__init__.py
ADDED
flopsearch/__init__.pyi
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
def flop(
|
|
4
|
+
data: np.ndarray,
|
|
5
|
+
lambda_bic: float,
|
|
6
|
+
*,
|
|
7
|
+
restarts: int,
|
|
8
|
+
timeout: float,
|
|
9
|
+
output_dag: bool = False,
|
|
10
|
+
) -> np.ndarray:
|
|
11
|
+
"""
|
|
12
|
+
Run the FLOP causal discovery algorithm.
|
|
13
|
+
|
|
14
|
+
Parameters
|
|
15
|
+
----------
|
|
16
|
+
data: A data matrix with rows corresponding to observations and columns to variables/nodes.
|
|
17
|
+
lambda_bic: The penalty parameter of the BIC, a typical value for structure learning is 2.0.
|
|
18
|
+
restarts: Optional parameter specifying the number of ILS restarts. Either restarts or timeout (below) need to be specified.
|
|
19
|
+
timeout: Optional parameter specifying a timeout after which the search returns. At least one local search is run up to a local optimum. Either restarts or timeout need to be specified.
|
|
20
|
+
output_dag: Optional parameter to output a DAG instead of a CPDAG. Default value is False.
|
|
21
|
+
|
|
22
|
+
Returns
|
|
23
|
+
-------
|
|
24
|
+
A matrix encoding a CPDAG or DAG. The entry in row i and column j is 1 in case of a directed edge from i to j and 2 in case of an undirected edge between those nodes (an additional 2 in row j and column i is omitted).
|
|
25
|
+
"""
|
|
26
|
+
...
|
|
Binary file
|
flopsearch/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flopsearch
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Summary: Python package providing an implementation of the FLOP causal discovery algorithm for linear additive noise models
|
|
8
|
+
Keywords: causal discovery,DAGs,Bayesian networks,structure learning
|
|
9
|
+
Author: Sebastian Weichwald, Leonard Henckel
|
|
10
|
+
Author-email: Marcel Wienöbst <marcel.wienoebst@gmx.de>
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
|
|
14
|
+
# flopsearch
|
|
15
|
+
|
|
16
|
+
Python package providing an implementation of the FLOP causal discovery algorithm for linear additive noise models.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
flopsearch can be installed via pip:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install flopsearch
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Citing FLOP
|
|
26
|
+
If you use FLOP in your scientific work, please cite this paper:
|
|
27
|
+
```bibtex
|
|
28
|
+
@article{cifly2025,
|
|
29
|
+
author = {Marcel Wien{"{o}}bst and Leonard Henckel and Sebastian Weichwald},
|
|
30
|
+
title = {{Embracing Discrete Search: A Reasonable Approach to Causal Structure Learning}},
|
|
31
|
+
journal = {{arXiv preprint arXiv:2510.04970}},
|
|
32
|
+
year = {2025}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Example
|
|
37
|
+
A simple example run of the FLOP algorithm provided by flopsearch.
|
|
38
|
+
|
|
39
|
+
``` py
|
|
40
|
+
import flopsearch
|
|
41
|
+
import numpy as np
|
|
42
|
+
from scipy import linalg
|
|
43
|
+
|
|
44
|
+
p = 10
|
|
45
|
+
W = np.diag(np.ones(p - 1), 1)
|
|
46
|
+
X = np.random.randn(10000, p).dot(linalg.inv(np.eye(p) - W))
|
|
47
|
+
X_std = (X - np.mean(X, axis=0)) / np.std(X, axis=0)
|
|
48
|
+
flopsearch.flop(X_std, 2.0, restarts=20)
|
|
49
|
+
```
|
|
50
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
flopsearch-0.1.3.dist-info/METADATA,sha256=JVX_fvtqJZGFRQayG9XLtnhLFBg3QgLaBsfRqIi7NsY,1551
|
|
2
|
+
flopsearch-0.1.3.dist-info/WHEEL,sha256=hnEjxG8MMZmmlhJat41pJlHVa7PMz9kEhUjTj-jdJr4,105
|
|
3
|
+
flopsearch.libs/libgcc_s-27e5a392.so.1,sha256=x5sO63liVwXxrjGGP371wB0RyQe1KEnIynYm82T0G0M,449745
|
|
4
|
+
flopsearch/__init__.py,sha256=UqRJYN7saLZWFc0psFyiG39C208VD3OUvagoo2sxfq0,123
|
|
5
|
+
flopsearch/__init__.pyi,sha256=yQdOZROGWM0k0sdNj-KiielkkQcxiAcEgxaunbqJw9E,1122
|
|
6
|
+
flopsearch/flopsearch.cpython-313-i386-linux-musl.so,sha256=01lzXI8X-I4ZuugkwA8F31Va0EIoTSMX2gn1tGUNdtw,805597
|
|
7
|
+
flopsearch/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
flopsearch-0.1.3.dist-info/RECORD,,
|
|
Binary file
|