netseg Documentation (Python)

Welcome to the netseg documentation. netseg is a python and R package for measuring segregation and structural polarization in social networks. It was developed to address several key gaps in the current ecosystem:

  • A Unified Framework: While analyzing network segregation and polarization is common, the myriad of existing measures makes cross-network comparisons exceedingly difficult. netseg provides a centralized toolkit for standardizing these measurements.

  • Extensively Documented: netseg is extensively documented. From various case by case usage examples to the advanced null-model selection, it offers a clear guide for your research.

  • Advanced Null-Model Comparison: Many existing approaches rely on purely random graphs to quantify excess polarization or segregation, a notoriously low baseline. netseg allows you to use customized network ensembles as null models, enabling robust, comparative segregation analysis.

  • Extensions and Improved Optimization netseg offers extensions for already existing measures, calculating the structural polarization and segregation in directed and undirected networks with multiple groups. netseg is build on igraph and NumPy , it offers near bare-metal speed with NumPy’s vectorization and igraph’s C backend.

Installation

You can install netseg from PyPI with

pip install netseg

or you can directly build from the source with (following will avoid assets, datasets and examples.)

git clone --filter=blob:none --sparse https://codeberg.org/OnurB/netseg.git
cd netseg
git sparse-checkout set src
pip install .

Support and Contact

If you come across any issues, please visit the repository pages.