Giter Club home page Giter Club logo

dynetx's Introduction

Hi I'm Giulio

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

About Me:

Recent Publications:

  • Feature-rich multiplex lexical networks reveal mental strategies of early language learning. Salvatore Citraro, Michael Vitevitch, Massimo Stella, and Giulio Rossetti. Scientific Reports, 2023
  • Where do migrants and natives belong in a community: a Twitter case study and privacy risk analysis. Jisu Kim, Francesca Pratesi, Giulio Rossetti, Alina Sı̂rbu, and Fosca Giannotti. Social Network Analysis and Mining, 2023
  • Cognitive network science reveals bias in GPT-3, ChatGPT, and GPT-4 mirroring math anxiety in high-school students. Katherine Abramski, Salvatore Citraro, Luigi Lombardi, Giulio Rossetti, and Massimo Stella. Big Data and Cognitive Computing, 2023
  • Attributed Stream Hypergraphs: temporal modeling of node-attributed high-order interactions. Andrea Failla, Salvatore Citraro, and Giulio Rossetti. Applied Network Science, 2023
  • Hypergraph models of the mental lexicon capture greater information than pairwise networks for predicting language learning. Salvatore Citraro, Judy Warner-Willich, Federico Battiston, Cynthia S.Q. Siew, Giulio Rossetti, and Massimo Stella. New Ideas in Psychology, 2023
  • Academic Mobility from a Big Data Perspective. Laura Pollacci, Letizia Milli, Tuba Bircan, and Giulio Rossetti. Journal of Data Science and Analytics, 2023

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

'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".

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?

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]

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
>>>

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.

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

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'

[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?

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!

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

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.