Code Monkey home page Code Monkey logo

dynetx's Introduction

Hi I'm Giulio


About Me

Recent Publications (from 2024)

  • Abramski, K., Ciringione, L., Rossetti, G., & Stella, M. (2024). Voices of rape: Cognitive networks link passive voice usage to psychological distress in online narratives. Computers in Human Behavior, 158, 108266.
  • Kim, J., Sirbu, A., Rossetti, G., Giannotti, F., Rapoport, H., & Pratesi, F. (2024). Origin and Destination attachment of migrants on Twitter.
  • Sîrbu, A., Goglia, D., Kim, J., Magos, P. M., Pollacci, L., Spyratos, S., ... & Iacus, S. M. (2024). International mobility between the UK and Europe around Brexit: a data-driven study. Journal of Computational Social Science, 1-32.
  • Stella, M., Citraro, S., Rossetti, G., Marinazzo, D., Kenett, Y. N., & Vitevitch, M. S. (2024). Cognitive modelling of concepts in the mental lexicon with multilayer networks: Insights, advancements, and future challenges. Psychonomic Bulletin & Review, 1-24.
  • Cazabet, R., Citraro, S., & Rossetti, G. (2023). Structify-Net: Random Graph generation with controlled size and customized structure. Peer Community Journal, 3.
  • Abramski, K., Lavorati, C., Rossetti, G., & Stella, M. (2024). LLM-Generated Word Association Norms. In HHAI 2024: Hybrid Human AI Systems for the Social Good (pp. 3-12). IOS Press.

Recent Preprints (from 2024)

  • Failla, Andrea, and Giulio Rossetti. "" I'm in the Bluesky Tonight": Insights from a Year Worth of Social Data." arXiv preprint arXiv:2404.18984 (2024).
  • Morini, V., Pansanella, V., Abramski, K., Cau, E., Failla, A., Citraro, S., & Rossetti, G. (2024). From Perils to Possibilities: Understanding how Human (and AI) Biases affect Online Fora. arXiv preprint arXiv:2403.14298.
  • Failla, A., Cazabet, R., Rossetti, G., & Citraro, S. (2024). Redefining Event Types and Group Evolution in Temporal Data. arXiv preprint arXiv:2403.06771.

Python Libraries for Network Analysis

libraries

Contacts

Feel free to contact me on:

Giulio Rossetti | Twitter Giulio's LinkedIN Giulio's Scholar Giulio's Gmail

dynetx's People

Contributors

dependabot[bot] avatar dormanh avatar ewouth avatar giuliorossetti avatar michaeldorner avatar pitmonticone avatar pyup-bot avatar tapdiego-amzn avatar utku-norman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dynetx's Issues

Saving dynamic graph in a format for plotting and viewing in software such as Gephi and community detection

Hi!

Thank you for this great package, it is really to use and works for my temporal data. I have a few questions:

I have 7 graphs which each represent a time point. Many nodes in each graph are common.. but may lose connections with nodes/gain connections with other nodes as time progresses.

As such I would like to be able to visualise this in a software package such as a gephi. The code i use to generate this dynamic network is:

import dynetx as dn

networklistOne = [graph1, graph2 etc...]
dynamic_graph = dn.DynGraph(edge_removal=True)
for t, graph in enumerate(networklistOne):
    dynamic_graph.add_interactions_from(graph.edges(data=True), t=t)

My questions are:

is there a way by which this can be saved in a format that can be understood by gephi? it is slightly different to networkx so I am not sure about this.

The total sum of the nodes in the dynamic graph is not equal to the collective number of nodes in each network. I am guessing this because these are common nodes? and that the idea here is that we want to understand which node networks are added/removed over time?

Community detection, is there a way of carrying out community detection in the dynamic graphs?

thank you in advance!

Error inheriting DynGraph

Hi,
I have been trying to create a sub class inheriting from DynGraph to implement some desired functionality:

import dynetx as dn
class myDynGraph(dn.DynGraph):
    # custom new method  
    def myMethod(self):
          pass

but when I instantiate the new class G = myDynGraph(), I have the following error:

  File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3417, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-da889620d25d>", line 1, in <module>
    a = myGraph()
  File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
    super(self.__class__, self).__init__(data, **attr)
  File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
    super(self.__class__, self).__init__(data, **attr)
  File "/home/glarrea/miniconda3/envs/this_is_a_test_dev/lib/python3.8/site-packages/dynetx/classes/dyngraph.py", line 121, in __init__
    super(self.__class__, self).__init__(data, **attr)
  [Previous line repeated 2981 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object

Modifying line 121 of dynetx/classes/dyngraph.py from :

121 super(self.__class__, self).__init__(data, **attr)
to:
121 super(DynGraph, self).__init__(data, **attr) worked for me.

Is there another way of inheriting without modifying the source code?

Thank you for the answer,

Gustavo

Transforming a snapshot into networkx graph

Hi,

Great job for this very useful library !

I have imported my data into a DynGraph object. I would like now to apply some networkx algorithm for each snapshot of the data separately, is there a way to easily transofrm each snapshot into a networkx graph ? Because even if a DynGraph object inherit from the nx.Graph class, the behaviours are not exactly the same.

Thanks

Unable to add Multigraph in dynetx

I am trying to add MultiGraph or MultiDiGraph in dynetx:

import dynetx as dn
G = dn.MultiGraph(edge_removal=True)

but getting the error:
AttributeError: module 'dynetx' has no attribute 'MultiGraph'

Create new release

Hi @GiulioRossetti! Now that #151 is merged and DyNetX now works with NetworkX 3.0, could you create a new release and deploy new wheels to PyPI? This way when using pip install dynetx it will install a version that works with NetworkX 3.0.

Problem with Dydigraph time_slice() + interactions()

Hi,
I was running the code for the example of the time_slice method, and the output does not match the one in the documentation.
Given:

G = dn.DynDiGraph()
G.add_interaction(0,1, t=0)
G.add_interaction(1,2, t=0)
G.add_interaction(2,3, t=0)
G.add_interaction(0,4, t=1)
G.add_interaction(4,5, t=1)
G.add_interaction(5,6, t=1)
G.add_interaction(7,1, t=2)
G.add_interaction(1,2, t=2)
G.add_interaction(2,3, t=2)
H = G.time_slice(0)
H.interactions()

The output should be: [(0, 1), (1, 2), (1, 3)], but instead, it is [(0, 1, {'t': [[0, -1]]})]. Notice also the -1 in the t. Nonetheless, for [e for e in G1.time_slice(0).edges()] the output is correct (except for the t, which continue to show -1).

Could it be related to how seen is populated in interactions_iter?

self edges do not show up when calling dn.interactions(G)

Self edges do not show up when I called dn.interactions(G) to get the list of all edges. However, G.has_interaction() indicates that such interaction exists.

>>> import dynetx as dn
>>> G = dn.DynGraph()
>>> G.add_interaction(0, 1, t=0)
>>> G.add_interaction(0, 2, t=0)
>>> G.add_interaction(0, 0, t=0)
>>> G.add_interaction(1, 1, t=0)
>>> G.add_interaction(2, 2, t=0)
>>> G.interactions(t=0)
[(0, 1, {'t': [0]}), (0, 2, {'t': [0]})]
>>> G.has_interaction(0, 0, t=0)
True
>>>

[DOC] Questions about the internal data structure for DynDiGraph and DynGraph

Hi,

Great package to extend networkx for a sorely needed functionality of graph representation! I am currently trying to PR the notion of a MixedEdgeGraph into networkx. With that, I am also interested in developing a time-series graph that can contain different types of edges. I am wondering if you can help elaborate on the inner data-structures of the DynGraphs and the "API contract".

  1. For example, what is time_to_edge attribute a dictionary comprised of? Are there any constraints?
  2. Same for snapshots attribute.
  3. How does the edge_removal attribute work? There seems to be no API to remove interactions?

I can help make a PR with inline comments and also documentation to help future users afterwards.

While I'm at it, I also have a question regarding the general API. I noticed that edge and node removals are not supported. Is there any limitations preventing this from being added? If so, is there anything I can do to help?

'DynGraph' object has no attribute '_node'

Hi.

I am getting this message every time that I want to add an interaction to an empty graph. Here is a snapshot of my code:

import dynetx as dn
g = dn.DynGraph(edge_removal=True)
g.add_interaction(u=1, v=2, t=0)

And the error:

AttributeError: 'DynGraph' object has no attribute '_node'

I installed the dynetx with "pip install dynetx".

nodes(t=x) function of a DynGraph() object returns the list of degrees of all nodes rather than the list of nodes.

As per documentation, the nodes(t=x) function of the class DynGraph, should be returning a list of the nodes in the graph at the snapshot x, as of now it is returning the list of degrees of each node at the snapshot x.

The example in the documentation is as below:

>>> import dynetx as dn
>>> G = dn.DynGraph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.add_path([0,1,2], 0)
>>> G.nodes(t=0)
[0, 1, 2]

whereas, on execution, it works as below:

>>> import dynetx as dn
>>> G = dn.DynGraph()
>>> G.add_path([0,1,2], 0)
>>> G.nodes(t=0)
[1, 2, 1]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.