node-conformity

Path-Aware local homophily score


Keywords
complex-networks, assortativity, homophily, paths
License
MulanPSL-2.0
Install
pip install node-conformity==0.0.2

Documentation

Conformity

PyPI download month

Conformity implements the path-aware homophily measure as introduced in:

G. Rossetti, S. Citraro and L. Milli.

Conformity: a Path-Aware Homophily measure for Node-Attributed Networks

Installation

Conformity requires python>=3.6.

To install the latest version of our library just download (or clone) the current project, open a terminal and run the following commands:

pip install -r requirements.txt
pip install .

Alternatively use pip:

pip install node_conformity

Usage

To compute the conformity score for the network nodes follow this example:

from conformity import attribute_conformity

g = nx.karate_club_graph()
node_to_conformity = attribute_conformity(g, list(np.arange(1, 4, 0.2)), ['club'], profile_size=1)