Comments (4)
Nice catch! This is just an outdated tutorial. Thanks for flagging this.
The issue here is that modifications were made to only use pandas arrays when the network/connections are sparse (I think if less than 25% of the connections are non-zero). This random network fills that criteria so it makes it a numpy array.
So I am creating a little to do list for myself here:
- Update the tutorial.
- Add code in tutorial to tests that are performed so this doesn't happen again
from teneto.
That makes sense! Setting prob=0.2
yields a Pandas DataFrame. Thanks for the explanation.
I'm guessing you made that choice to optimise the code in some way.
I'm just thinking, if I write some general code, and then run it on some different datasets, some might be a bit more or a bit less sparse than your threshold. Then, the same code might run or not run, or just yield different results, because of this. Does this not have the potential to create some trouble? Of course I guess I could just check the data and adapt the code every time.
from teneto.
Does this not have the potential to create some trouble?
It is a good point.
-
All teneto functions are agnostic to whether TemporalNetwork.network is a dataframe or numpy array (and most functions can take HDF dataframes as well (some parts of this are still being optimized though)).
-
If the user want's to always have dataframe there is an argument when defining TemporalNetwork: forcesparse, which, if True, will make sure the TemporalNetwork.network be a dataframe. I have planned to make this "force_df" and "force_array" but that has been low down on the priority list (or representation=['auto','df','array'])
This behaviour is the an unfortunate trade-off I've had to make for wanting to be quick on small datasets and be able to cope with very large datasets. Trying to find one representation that is (1) familiar for a user to interact with (np or pd), (2) efficient for quick processing, (3) efficient for large networks, is something I hope to implement at one point. But for now, this was the best solution I could think of..
from teneto.
I sensed it would be something like this, it makes sense, thanks. Your point 1. should make it quite safe. In any case I don't have a better solution either, I jut got surprised because I even prob=0.3 yielded sometimes sparse and sometimes dense nets!
from teneto.
Related Issues (20)
- tnet.T incorrect when tnet is sparse and starttime!=0 HOT 6
- 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
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.