Network & Metric Backbone comparison¶

Network: High school (results only)¶


Reference: R. Mastrandrea, J. Fournet, A. Barrat, Contact patterns in a high school: a comparison between data collected using wearable sensors, contact diaries and friendship surveys. PLoS ONE 10(9): e0136497 (2015).

Original data: http://www.sociopatterns.org/datasets/high-school-contact-and-friendship-networks/

In [1]:
from IPython.core.display import display, Math, Image, HTML, Markdown
import pandas as pd
In [2]:
project = 'high-school'
normalization = 'social'
In [3]:
display(Image(url='images/{:s}/{:s}/graph_original_metalabels.png'.format(project,normalization), width=600))
In [4]:
display(Markdown('## Modularity in networks with original node position'))
display(Image(url='images/{:s}/{:s}/graph_comparison.png'.format(project,normalization)))

Modularity in networks with original node position¶

In [5]:
display(Markdown('## Modularity in networks with recomputed node position'))
Image(url='images/{:s}/{:s}/graph_comparison_layout.png'.format(project,normalization))

Modularity in networks with recomputed node position¶

Out[5]:

Modules¶

In [6]:
index = ['Meta labels','Louvain']
data = [
    ('9' ,'-','-' ,'-'),
    ('10','17','28','47.19(±3.79)'),
]
pd.DataFrame(data, columns=['Original','Metric','Threshold','Random*'], index=index)
Out[6]:
Original Metric Threshold Random*
Meta labels 9 - - -
Louvain 10 17 28 47.19(±3.79)

$h$, $y$, $J$ and $\text{clusim}$ measures¶

In [7]:
display(HTML("""
<table><tr>
    <th colspan="2" rowspan="2">$h_{A \\to B}$ / $h_{B \\to A}$</th>
    <th colspan="4">B</th>
  </tr><tr>
    <td>Original proximity</td>
    <td>Backbone</td>
    <td>Threshold</td>
    <td>Random*</td>
  </tr><tr>
    <th rowspan="2">A</th>
    <td>Meta labels</td>
    <td>0.09/0.08</td>
    <td>0.22/0.12</td>
    <td>0.26/0.06</td>
    <td>0.44(±1.81e-02)/0.12(±1.62e-02)</td>
  </tr><tr>
    <td>Original proximity</td>
    <td>-</td>
    <td>0.15/0.04</td>
    <td>0.18/0.01</td>
    <td>0.42(±1.87e-02)/0.13(±1.63e-02)</td>
  </tr></table>
  <small>* Results on 100 realizations.</small>
"""))
$h_{A \to B}$ / $h_{B \to A}$ B
Original proximity Backbone Threshold Random*
A Meta labels 0.09/0.08 0.22/0.12 0.26/0.06 0.44(±1.81e-02)/0.12(±1.62e-02)
Original proximity - 0.15/0.04 0.18/0.01 0.42(±1.87e-02)/0.13(±1.63e-02)
* Results on 100 realizations.
In [8]:
display(HTML("""
<table><tr>
    <th colspan="2" rowspan="2">$y_{AB}$</th>
    <th colspan="4">B</th>
  </tr><tr>
    <td>Original proximity</td>
    <td>Backbone</td>
    <td>Threshold</td>
    <td>Random*</td>
  </tr><tr>
    <th rowspan="2">A</th>
    <td>Meta labels</td>
    <td>0.88</td>
    <td>0.691</td>
    <td>0.544</td>
    <td>0.39(±1.55e-02)</td>
  </tr><tr>
    <td>Original proximity</td>
    <td>-</td>
    <td>0.754</td>
    <td>0.595</td>
    <td>0.38(±0.02)</td>
  </tr></table>
  <small>* Results on 100 realizations.</small>
"""))
$y_{AB}$ B
Original proximity Backbone Threshold Random*
A Meta labels 0.88 0.691 0.544 0.39(±1.55e-02)
Original proximity - 0.754 0.595 0.38(±0.02)
* Results on 100 realizations.
In [9]:
display(HTML("""
<table><tr>
    <th colspan="2" rowspan="2">$J_{A \\to B}$ / $J_{B \\to A}$</th>
    <th colspan="4">B</th>
  </tr><tr>
    <td>Original proximity</td>
    <td>Backbone</td>
    <td>Threshold</td>
    <td>Random*</td>
  </tr><tr>
    <th rowspan="2">A</th>
    <td>Meta labels</td>
    <td>0.89/0.81</td>
    <td>0.75/0.47</td>
    <td>0.67/0.29</td>
    <td>0.35(±3.61e-02)/0.14(±1.46e-02)</td>
  </tr><tr>
    <td>Original proximity</td>
    <td>-</td>
    <td>0.82/0.56</td>
    <td>0.75/0.35</td>
    <td>0.34(±0.04)/0.14(±0.01)</td>
  </tr></table>
  <small>* Results on 100 realizations.</small>
"""))
$J_{A \to B}$ / $J_{B \to A}$ B
Original proximity Backbone Threshold Random*
A Meta labels 0.89/0.81 0.75/0.47 0.67/0.29 0.35(±3.61e-02)/0.14(±1.46e-02)
Original proximity - 0.82/0.56 0.75/0.35 0.34(±0.04)/0.14(±0.01)
* Results on 100 realizations.
In [10]:
display(HTML("""
<table><tr>
    <th colspan="2" rowspan="2">$\\text{clusim}_{AB}$</th>
    <th colspan="4">B</th>
  </tr><tr>
    <td>Original proximity</td>
    <td>Backbone</td>
    <td>Threshold</td>
    <td>Random*</td>
  </tr><tr>
    <th rowspan="2">A</th>
    <td>Meta labels</td>
    <td>0.87</td>
    <td>0.66</td>
    <td>0.56</td>
    <td>0.27(±3.53e-02)</td>
  </tr><tr>
    <td>Original proximity</td>
    <td>-</td>
    <td>0.72</td>
    <td>0.62</td>
    <td>0.26(±0.03)</td>
  </tr></table>
  <small>* Results on 100 realizations.</small>
"""))
$\text{clusim}_{AB}$ B
Original proximity Backbone Threshold Random*
A Meta labels 0.87 0.66 0.56 0.27(±3.53e-02)
Original proximity - 0.72 0.62 0.26(±0.03)
* Results on 100 realizations.
In [12]:
display(Markdown('## Modularity Quality'))
display(Markdown('## Metric Backbone'))
display(Image(url='images/{:s}/{:s}/high-school-social-meta-original-metric(Not condensed).PNG'.format(project,normalization), width=800))
display(Markdown('## Threshold "Backbone"'))
display(Image(url='images/{:s}/{:s}/high-school-social-threshold.PNG'.format(project,normalization), width=800))
display(Markdown('## Random "Backbone")"'))
display(Image(url='images/{:s}/{:s}/high-school-social-random.PNG'.format(project,normalization), width=800))

Modularity Quality¶

Metric Backbone¶

Threshold "Backbone"¶

Random "Backbone")"¶