Git Product home page Git Product logo

climate-companions-bipartite's Introduction

climate-companions-bipartite

Code for investigating the event co-participation based bipartite graph structure in the Ilmastokumppanit (Climate Companions) city-to-business network. Should be applicable also to other bipartite module analyses.

functions.py contains functions needed for creating and analysing the bipartite network. The functions can be called from either a frontend script (frontend.py was used for creating the results of the related article) or interactively. parameters.py stores all parameters used in the analysis.

For a short(-ish) walkthrough of the code and main results, have a look at walkthrough.py (related data is stored at walkthrough_data). The easiest way to do that is to launch Binder (that saves you the trouble of setting package versions or even installing python):

Binder

(Preparing the environment may take a while. When it opens, just click walkthrough.py to launch the notebook).

The versions used are Python 2.7, pandas 0.22.0, Numpy 1.14.0, NetworkX 2.1, Scipy 1.0.0, and Matplotlib 2.1.2.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

climate-companions-bipartite's People

Contributors

onerva-korhonen avatar

Stargazers

Thomas Banafa avatar

Watchers

James Cloos avatar

climate-companions-bipartite's Issues

add a separator parameter to readNodes

csv files can use different separators; better to give the separator as a parameter to the readNodes function so there's no need to edit the files
NOTE: this is now hardcoded to ;

years and link paths

At the moment, years and input paths are given as separate parameters. This may cause mismatch (match between these two lists must be manually checked). So, it might be better to give just years and construct paths from them.

colormap

Check the colormap (defined in parameters.py)! It should be as distinctive as possible with at least 20 clearly different values. 'tab20' would be ideal but for some reason I don't get it working - maybe it has been removed from some versions of matplotlib (or not added to others).

visualization settings function

Write a function for getting the visualization settings used in the paper (this could be used in the example frontend script). The function should give cfg as output.

Normalized diversity

Divide the effective diversity by richness to see how far away the clique is from its theoretical maximum diversity and plot this against clique size.

layout

In order to get the same layout for all network visualizations from different functions, consider calculating the layout in frontend and passing it as a parameter.

networkx version

networkx 1.X and 2.X handle bipartites differently (they seem to be a separate class in nx 2.X). So, consider setting a standard version of nx in the beginning of the functions file.

testing against random: add a t-test

The significance of the difference between the observed value and the mean of random distribution could be tested as a one-sample t-test for average: is the average of random networks different from the observed value?

Remove non-member nodes from starness analysis

These nodes are companies/instances that visit some events but are not members. So, their presence most probably artificially increases starness and they should therefore be excluded from the analysis.

node shape in visualization

Add different node shapes for "support members" (universities) and non-member participants. To do this, nodes should at the network construction step be assigned with a membership class. Then, shapes can be set in the drawNetwork function.

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.