-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1be34ac
commit c9099aa
Showing
6 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
***************** | ||
Opinion Evolution | ||
***************** | ||
|
||
The Opinion Evolution plot shows the node-wise opinion evolution in a continuous states model. | ||
|
||
.. autoclass:: ndlib.viz.mpl.OpinionEvolution.OpinionEvolution | ||
.. automethod:: ndlib.viz.mpl.OpinionEvolution.OpinionEvolution.__init__(model, trends) | ||
.. automethod:: ndlib.viz.mpl.OpinionEvolution.OpinionEvolution.plot(filename) | ||
|
||
|
||
Below is shown an example of Opinion Evolution description and visualization for the Algorithmic Bias model. | ||
|
||
.. code-block:: python | ||
import networkx as nx | ||
import ndlib.models.ModelConfig as mc | ||
import ndlib.models.opinions as op | ||
from ndlib.viz.mpl.OpinionEvolution import OpinionEvolution | ||
# mMean field scenario | ||
g = nx.complete_graph(100) | ||
# Algorithmic Bias model | ||
model = op.AlgorithmicBiasModel(g) | ||
# Model configuration | ||
config = mc.Configuration() | ||
config.add_model_parameter("epsilon", 0.32) | ||
config.add_model_parameter("gamma", 0) | ||
model.set_initial_status(config) | ||
# Simulation execution | ||
iterations = model.iteration_bunch(100) | ||
viz = OpinionEvolution(model, iterations) | ||
viz.plot("opinion_ev.pdf") | ||
.. figure:: opinion_ev.png | ||
:scale: 80 % | ||
:align: center | ||
:alt: Algorithmic Bias Opinion Evolution Example | ||
|
||
SIR Diffusion Trend Example. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters