Metadata-Version: 2.1
Name: coordinationz
Version: 0.3.0
Summary: Package to estimate activity-conditioned coordination in online behavior.
Author-Email: "Filipi N. Silva" <filipinascimento@gmail.com>, Manita Pote <potem@iu.edu>, Lake Yin <lakeyin@iu.edu>, David Axelrod <daaxelro@iu.edu>, Luca Luceri <lluceri@isi.edu>, Ashwin Balasubramanian <ashwinb@isi.edu>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Project-URL: Documentation, https://github.com/osome-iu/coordinationz#readme
Project-URL: Source, https://github.com/osome-iu/coordinationz
Project-URL: Tracker, https://github.com/osome-iu/coordinationz/issues
Requires-Python: >=3.10
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.1
Requires-Dist: scipy
Requires-Dist: tqdm
Requires-Dist: toml
Requires-Dist: igraph<1,>=0.11
Requires-Dist: xnetwork>=1.0.4
Provides-Extra: figures
Requires-Dist: matplotlib>=3.8; extra == "figures"
Provides-Extra: coword
Requires-Dist: nltk; extra == "coword"
Requires-Dist: spacy>=3.7; extra == "coword"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Description-Content-Type: text/markdown

# CoordinationZ

CoordinationZ estimates whether two accounts' shared activity is unusual given how active the accounts are and how often each item is shared. The package contains the activity-conditioned null model. The repository also provides the scripts for reproducing the figures in *A null model to detect coordinated online behavior integrating evidence from multiple indicators*. [Preprint](https://doi.org/10.48550/arXiv.2610.17533)

## Install

```bash
python -m pip install coordinationz
```

Wheels are built for CPython 3.10–3.12 on Linux x86-64, macOS (Apple Silicon and Intel), and Windows x86-64. Building from source requires a C compiler and, on Linux, OpenMP. The macOS and Windows wheels run the streaming sampler serially. Use version 0.3.0 for the code described here.

## Run a small example

Each tuple represents one occurrence. Keep repeated account–item tuples to preserve counts.

```python
from coordinationz.nullmodel import bipartiteNullModelSimilarity

occurrences = [
    ("a", "post-1"), ("a", "post-2"), ("a", "post-2"),
    ("b", "post-1"), ("b", "post-2"), ("c", "post-3"),
]
result = bipartiteNullModelSimilarity(
    occurrences,
    backend="c_streaming",
    idf="smoothlog",
    realizations=10_000,
    workers=2,
    seed=9999,
    showProgress=False,
)
for (i, j), similarity, p in zip(
    result["indexedEdges"], result["similarities"], result["pvalues"]
):
    print(result["labels"][i], result["labels"][j], similarity, p)
```

The output contains pairs with positive observed similarity. A missing indicator contributes a value of one in the ranking pipeline. Combined pair and account scores are ranking statistics. See the replication guide for the filters and scoring rules.

## Reproduce the figures

From a Git checkout, install the plotting dependencies and run the figure scripts:

```bash
python -m pip install '.[figures]'
python reproduction/figures/make_all.py
```

This writes vector PDFs and SVGs to `reproduction/rendered/` using the bundled aggregate figure inputs. See the [replication guide](docs/replication.md) for the figure index, raw benchmark workflow, optional co-word analysis, and verification commands. The historical INCAS and community workflows are available in the [0.2.2 source](https://github.com/osome-iu/coordinationz/tree/v0.2.2). See [release instructions](docs/releasing.md) for PyPI publishing.
