Comments (15)
from teneto.
It seems that argument is not present, at least in my version. I tried 'forcesparse=True' and also 'hdf5=True' without success. What's more, the error is the same, which I wouldn't expect in the latter case as it should use a different format.
The network has around 900 nodes and 33720 time-stamped links
from teneto.
Sorry I meant forcesparse=True (was sitting on a train and didn't doublecheck the argument). So the HDF5 compatibility was never complete/optimized as it was also slowing down processing on smaller networks. And it is on my todo list to fix all this in December when I have time to contribute to this instead of other projects. So bare with me here. There may be one or two errors, but we can probably get them sorted quite easily when they arise.
But this problem seems to be the function trying to figure out what type of network your input and it is trying to make the dataframe a numpy array to determine this (not optimal). So if you add the argument: nettype='bu'
(or 'bd', 'wu', 'wd') depending on if you network is binary/weighted undirected/directed, this function shouldn't be called.
That is slightly bigger than most of the networks I usually use (ca 500 nodes and 1000 time points). But the HDF5 representation should work.
from teneto.
this indeed worked! setting the type also makes 'forcespars' or HDF5 seemingly unnecessary.
Quick unrelated question (to avoid opening another issue): is it possible to have references for the centrality measures implemented in the library? Like the formula or article they are referring to.
Thanks for your quick help!
Alberto
from teneto.
Which centrality measure in particular are you after?
I generally follow Masuda and Lambiotte's book "A guide to temporal networks" for the maths for many of the measures. Adding citations to all the docstrings is also on the todo list. Some of them already have quite detailed information in the docmentation (e.g. here, but I've not had time to write one for every measure yet).
So if there is any you want want me to find, I can find them for you and also add them to the docstrings and provide the references for you here too.
from teneto.
I was mainly interested in the centrality for now. So closeness, betwenness and degree are the ones missing. I am asking because I found different definitions in different papers, and as of now I am not able to get a copy of the book to look for them by myself.
Really appreciate your help here!
from teneto.
Alright. I have some writing time assigned later today. So I'll add them then. So within 24 hours I'll have the the documentation of all three of those. And, especially for closeness and betweenness I'll add to the documentation of shortest temporal paths as well (as that is the place I've seen the most diffferences in equations).
from teneto.
You may want to update from the developer branch: https://github.com/wiheto/teneto/tree/develop as some argument names are changing in the upcoming 0.5.0, so the documentation isn't fully in line with the functions in 0.4.6
The more in depth documentation is here:
As with a lot of teneto's documentation, I write far too quickly to get doc coverage, and sometimes loose clarity. Just leave an issue whenever anything is unclear
2 changes still to make.
So the shortest temporal paths is HDF5 ready but the calculation of closeness centrality is not. It is an easy fix. but I want to test it tomorrow to make sure it works. But since you will need the shortest temporal paths for both bet centrality and closeness, you may as well precompute that first anyway and save it.
I didn't get round to betweenness centrality docs. I'll also try and do that tomorrow.
from teneto.
I've also updated the normalization to follow the reference before for 0.5.0. Previously it did not divide by sigma_jk. I need to write a test to make sure this is working as expected (today or tomorrow)
Otherwise, can I close this issue now? Seems like the problems are sorted.
from teneto.
Yes, everything should be fine. Just a question: how quick you expect the shortest path function to be? I tried it with a network of around 90 nodes and 300 links and after 6 hours it wasn't finished yet (core i7 on laptop).
Also, it is better to first compute the shortest paths and then use them as argument for closeness and betweenness right?
from teneto.
Also, there might be another issue with the shortest path function:
Whereas with a 'bd' network the behavior is as described above, the same network but loaded as 'bu' returns the following error:
File "", line 1, in
shortest_paths = tnt.networkmeasures.shortest_temporal_path(t)
File "C:\ProgramData\Anaconda3\lib\site-packages\teneto\networkmeasures\shortest_temporal_path.py", line 201, in shortest_temporal_path
network = tnet.get_network_when(ij=list(ij), t=t)
File "C:\ProgramData\Anaconda3\lib\site-packages\teneto\classes\network.py", line 483, in get_network_when
return teneto.utils.get_network_when(self, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\teneto\utils\utils.py", line 993, in get_network_when
network['j'].isin(ij))), (network['t'].isin(t)))]
TypeError: and_ expected 2 arguments, got 1
from teneto.
Yes, everything should be fine. Just a question: how quick you expect the shortest path function to be? I tried it with a network of around 90 nodes and 300 links and after 6 hours it wasn't finished yet (core i7 on laptop).
So when making the HDF5 compatible objects I compromised on speed. This is the major backbones issues regarding speed that has to be solved that is planned for the end of December (the start of #36 is relevant here).
Also, it is better to first compute the shortest paths and then use them as argument for closeness and betweenness right?
Yes, cause otherwise you have to calculate the paths twice, and that is the most computationally intense part.
Regarding the error. Interesting. I'm going to open up a new issue about that as that is about undirected HDF5 network referencing.
from teneto.
Also, regarding speed of shortest_temporal_paths: to minimize the possible path space, you could change the value of steps_per_t
.
The default parameter of steps_per_t
in shortest_temporal_path is 'all'. This means that, at each time-point, a path can travel multiple nodes.This is not a reasonable assumption in many temporal networks. If you set this parameter to an integer (e.g. to 1 meaning that only one edge can be traveling per time-point per path), it will speed up the calculation.
from teneto.
And another possible way to speed it up at the moment is to set i
argument and run it in parallel (so for 90 nodes you can run 90 jobs at once. But will require access to a cluster).
from teneto.
Aside from the computational time, I think all the issues here have been solved. So closing this issues.
from teneto.
Related Issues (20)
- Error TenetoBIDS numpy input does not save to json sidecar HOT 1
- Closeness centrality running without interruption HOT 9
- Remove dependencies on neural-specific modules but issue a warning if a function is trying to be used that requires it HOT 21
- [Question] shortest_temporal_path HOT 6
- MemoryError while loading graph HOT 14
- Control colormap of temporal graph nodes HOT 4
- Plotting slice_plot will fail if dataframe columns in wrong order HOT 4
- Improve shortest temporal paths (speed issues) HOT 1
- [ENH] Prewhiten prior to derive_temporalnetwork
- AttributeError: module 'sqlalchemy.util' has no attribute 'dependencies' after importing TemporalNetworks() HOT 3
- wrong number of nodes from TN.N and in netshape HOT 2
- Speed up the shortest path calculation speed HOT 1
- An error: The object 'TemporalNetwork' can't import dataframe data of weighted network HOT 3
- Label node on temporalnetwork ploting HOT 1
- Inconsistency when plotting slice plot a temporal network HOT 6
- How to make a community slice plot HOT 2
- Calculating consensus partition in teneto HOT 2
- Possible Typo in test_communitydetection.py
- Network Properties calculation speed problem HOT 3
- Deprecated call to scipy.temporal.distance.matching
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teneto.