flopsearch 0.1.3__cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.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 ADDED
@@ -0,0 +1,5 @@
1
+ from .flopsearch import *
2
+
3
+ __doc__ = flopsearch.__doc__
4
+ if hasattr(flopsearch, "__all__"):
5
+ __all__ = flopsearch.__all__
@@ -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
+ ...
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,7 @@
1
+ flopsearch-0.1.3.dist-info/METADATA,sha256=JVX_fvtqJZGFRQayG9XLtnhLFBg3QgLaBsfRqIi7NsY,1551
2
+ flopsearch-0.1.3.dist-info/WHEEL,sha256=IMX-PW-t3uRkEZoSiIqRcw6YP563eSm-5Cl82dU9zO8,129
3
+ flopsearch/__init__.py,sha256=UqRJYN7saLZWFc0psFyiG39C208VD3OUvagoo2sxfq0,123
4
+ flopsearch/__init__.pyi,sha256=yQdOZROGWM0k0sdNj-KiielkkQcxiAcEgxaunbqJw9E,1122
5
+ flopsearch/flopsearch.cpython-313-arm-linux-gnueabihf.so,sha256=5EAy3IxjDWzw-r-cMwjimIuUhSN-y5ROZbEaOd48x1E,802100
6
+ flopsearch/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ flopsearch-0.1.3.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.9.6)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l