Skip to content

Commit

Permalink
deploy: 0d2c5d9
Browse files Browse the repository at this point in the history
  • Loading branch information
mannbach committed Sep 12, 2024
1 parent c89b2df commit fcdf166
Show file tree
Hide file tree
Showing 74 changed files with 14,574 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alpha/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d64ad0606c00d935d6d8a4fb6fab342e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added alpha/.doctrees/environment.pickle
Binary file not shown.
Binary file added alpha/.doctrees/extensions/events.doctree
Binary file not shown.
Binary file added alpha/.doctrees/extensions/filters.doctree
Binary file not shown.
Binary file added alpha/.doctrees/extensions/index.doctree
Binary file not shown.
Binary file added alpha/.doctrees/extensions/mechanisms.doctree
Binary file not shown.
Binary file added alpha/.doctrees/extensions/models.doctree
Binary file not shown.
Binary file added alpha/.doctrees/graphs.doctree
Binary file not shown.
Binary file added alpha/.doctrees/index.doctree
Binary file not shown.
Binary file added alpha/.doctrees/models/directed.doctree
Binary file not shown.
Binary file added alpha/.doctrees/models/index.doctree
Binary file not shown.
Binary file added alpha/.doctrees/models/undirected.doctree
Binary file not shown.
Binary file added alpha/.doctrees/node_vectors/index.doctree
Binary file not shown.
Binary file added alpha/.doctrees/references.doctree
Binary file not shown.
Binary file added alpha/.doctrees/statistics.doctree
Binary file not shown.
Binary file added alpha/.doctrees/utilities.doctree
Binary file not shown.
Binary file added alpha/.doctrees/visualizations.doctree
Binary file not shown.
43 changes: 43 additions & 0 deletions alpha/_sources/extensions/events.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Event Handling
==============

Several other classes implement the :class:`.HasEvents` interface.
In that case, they should provide a :attr:`.HasEvents.EVENTS` list that contains the :class:`Events <.Event>` that they implement.

If you wish to inject your own code, check :meth:`.HasEvents.register_event_handler`.
As an example, consider the (shortened) implementation of :class:`.SimulationTimer`:

.. code:: python
class SimulationTimer:
_start_time: float # Starting time
time: Optional[float] = None # Final measure
def __init__(self, model: Model) -> None:
# Start timer with simulation
model.register_event_handler(
Event.SIMULATION_START, self._start_timer)
# End timer with simulation
model.register_event_handler(
Event.SIMULATION_END, self._end_timer)
def _start_timer(self):
# Sets the starting time
self._start_time = time.time()
def _end_timer(self):
# Computes the final simulation run
self.time = time.time() - self._start_time
This code registers two functions to measure the simulation.
When the simulation starts, the :meth:`_start_timer` method is called to store the starting time.
Once the simulation ends, :meth:`_end_timer` takes again the time and subtracts the starting time.
After the simulation, the :attr:`time` attribute contains the runtime of the simulation.

.. autoclass:: netin.utils.Event
:members:
:undoc-members:
.. autoclass:: netin.utils.HasEvents
:members:
14 changes: 14 additions & 0 deletions alpha/_sources/extensions/filters.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Filters
==========

.. autoclass:: netin.filters.Filter
:members:

.. autoclass:: netin.filters.NoDoubleLinks
:members:

.. autoclass:: netin.filters.NoSelfLinks
:members:

.. autoclass:: netin.filters.ActiveNodes
:members:
29 changes: 29 additions & 0 deletions alpha/_sources/extensions/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Extending NetIn
===============

The package provides multiple interfaces to extend its functionalities.

Several classes implement the :class:`.HasEvents` interface which can be used to inject your own code at runtime.

.. toctree::
:maxdepth: 2

events

Alternatively, you can extend the existing class structure to facilitate the existing simulation code, changing only specific modeling details.
:class:`.Filter` and :class:`.LinkFormationMechanism` provide abstract classes that describe how target nodes are chosen during simulation.

.. toctree::
:maxdepth: 2

filters
mechanisms

Both custom and existing implementations (e.g., :class:`.Homophily`) can be used in custom models to reuse the existing simulation logic.
In that case, only some of the simulation methods have to be reimplemented.
For this purpose, several abstract base classes define varying levels of modelling abstractions.

.. toctree::
:maxdepth: 2

models
20 changes: 20 additions & 0 deletions alpha/_sources/extensions/mechanisms.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Link Formation Mechanisms (LFM)
===============================

.. autoclass:: netin.link_formation_mechanisms.LinkFormationMechanism
:members:

.. autoclass:: netin.link_formation_mechanisms.Uniform
:members:

.. autoclass:: netin.link_formation_mechanisms.PreferentialAttachment
:members:

.. autoclass:: netin.link_formation_mechanisms.InDegreePreferentialAttachment
:members:

.. autoclass:: netin.link_formation_mechanisms.Homophily
:members:

.. autoclass:: netin.link_formation_mechanisms.TriadicClosure
:members:
18 changes: 18 additions & 0 deletions alpha/_sources/extensions/models.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Model
=====

.. autoclass:: netin.models.Model
:members:
:private-members:

.. autoclass:: netin.models.BinaryClassModel
:members:
:private-members:

.. autoclass:: netin.models.UndirectedModel
:members:
:private-members:

.. autoclass:: netin.models.DirectedModel
:members:
:private-members:
10 changes: 10 additions & 0 deletions alpha/_sources/graphs.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Graphs
=======

.. autoclass:: netin.graphs.Graph
:members:
:inherited-members:

.. autoclass:: netin.graphs.DiGraph
:members:
:inherited-members:
58 changes: 58 additions & 0 deletions alpha/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. NetIn documentation master file, created by
sphinx-quickstart on Wed Apr 19 11:08:02 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Network Inequality
=================================

.. automodule:: netin

Existing models are defined by the following :class:`.Model` class implementations.


.. toctree::
:maxdepth: 3

models/index

Each model can be simulated by running the :meth:`.Model.simulate` method, returning the simulated network as a :class:`.Graph` instance.

.. toctree::
:maxdepth: 2

graphs

:class:`Graphs <.Graph>` typically contain node attributes in the form of :class:`NodeVectors <NodeVector>`.
For most models, these vectors contain the group assignments of nodes to a minority or majority class as :class:`.BinaryClassNodeVector`.

.. toctree::
:maxdepth: 2

node_vectors/index

Besides the implementation of models, `NetIn` offers functionality to analyze existing (or simulated) networks in terms of various inequalities they exhibit.

.. toctree::
:maxdepth: 1

statistics

If you want to create your own custom models or inject your own code during simulation of existing models, `NetIn` is highly extendible.
It also provides utility functions to visualize networks and inequality results.

.. toctree::
:maxdepth: 1

extensions/index
visualizations
utilities

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. include:: references.rst
14 changes: 14 additions & 0 deletions alpha/_sources/models/directed.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Directed Graph Models
=====================

.. autoclass:: netin.models.DHModel
:members:
:inherited-members:

.. autoclass:: netin.models.DPAModel
:members:
:inherited-members:

.. autoclass:: netin.models.DPAHModel
:members:
:inherited-members:
9 changes: 9 additions & 0 deletions alpha/_sources/models/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Models
=======

.. toctree::
:maxdepth: 2
:glob:

directed
undirected
22 changes: 22 additions & 0 deletions alpha/_sources/models/undirected.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Undirected Graph Models
=======================

.. autoclass:: netin.models.BarabasiAlbertModel
:members:
:inherited-members:

.. autoclass:: netin.models.HomophilyModel
:members:
:inherited-members:

.. autoclass:: netin.models.PAHModel
:members:
:inherited-members:

.. autoclass:: netin.models.PATCHModel
:members:
:inherited-members:

.. autoclass:: netin.models.CompoundLFM
:members:
:inherited-members:
14 changes: 14 additions & 0 deletions alpha/_sources/node_vectors/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Node vectors
============

.. autoclass:: netin.graphs.NodeVector
:members:
:inherited-members:

.. autoclass:: netin.graphs.CategoricalNodeVector
:members:
:inherited-members:

.. autoclass:: netin.graphs.BinaryClassNodeVector
:members:
:inherited-members:
22 changes: 22 additions & 0 deletions alpha/_sources/references.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
References
==========

.. Please follow alphabetical ordering
.. [BarabasiAlbert1999]
| A. L. Barabasi and R. Albert "Emergence of scaling in random networks", Science 286, pp 509-512, 1999.
.. [Espin-Noboa2022]
| L. Espín-Noboa, C. Wagner, M. Strohmaier, & F. Karimi "Inequality and inequity in network-based ranking and recommendation algorithms" Scientific reports 12(1), 1-14, 2022.
.. [Espin-Noboa2017]
| L. Espín-Noboa, F. Lemmerich, M. Strohmaier, & P. Singer, P. "JANUS: A hypothesis-driven Bayesian approach for understanding edge formation in attributed multigraphs" Applied Network Science, 2, 1-20.
.. [Karimi2018]
| F. Karimi, M. Génois, C. Wagner, P. Singer, & M. Strohmaier, M "Homophily influences ranking of minorities in social networks", Scientific reports 8(1), 11077, 2018.
.. [Gini]
| `Gini coefficient <http://www.statsdirect.com/help/default.htm#nonparametric_methods/gini.htm>`_ and `Implementation <https://github.com/oliviaguest/gini/blob/master/gini.py>`_
.. [Yang2017]
| J. Yang, B. Ribeiro, & J. Neville "Should We Be Confident in Peer Effects Estimated From Social Network Crawls?" ICWSM (Vol. 11, No. 1, pp. 708-711), 2017.
11 changes: 11 additions & 0 deletions alpha/_sources/statistics.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Statistics
==========

.. automodule:: netin.stats.distributions
:members:

.. automodule:: netin.stats.networks
:members:

.. automodule:: netin.stats.ranking
:members:
5 changes: 5 additions & 0 deletions alpha/_sources/utilities.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Utility Functions
=================

.. autoclass:: netin.utils.SimulationTimer
:members:
5 changes: 5 additions & 0 deletions alpha/_sources/visualizations.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Visualization
=============

.. automodule:: netin.viz.handlers
:members:
Loading

0 comments on commit fcdf166

Please sign in to comment.