Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 2.18 KB

score_aggregation.rst

File metadata and controls

64 lines (49 loc) · 2.18 KB

Score aggregations

In multiXrank version v.0.1, the scores of the nodes in the different layers of each multiplex network were aggregated using a geometric mean. In the latest version of multiXrank (v.0.2), the user can choose an aggregation strategy between the following ones:

  • nomean: non-aggregated score


    xk = [pk1, pk2, ..., pkLi]

  • mean: arithmetic mean


    $$x_{k} = \frac{ \sum_{j=0}^{L_{i}} p_{kj} }{L_{i}}$$

  • gmean: geometric mean


    $$x_{k} = \sqrt[L_{i}]{ \prod_{j=0}^{L_{i}} p_{kj} }$$

  • hmean: harmonic mean


    $$x_{k} = \frac{ L_{i} }{ \sum_{j=0}^{L_{i}} \frac{1}{ p_{kj}} }$$

  • sum: sum of nodes score through each layer


    $$x_{k} = \sum_{j=0}^{L_{i}} p_{kj}$$

where xk is the score of the node k, Li is the number of layers in the multiplex network i, pkj is the score of the node k in the layer j of the multiplex network i.

By default, the aggregation uses the geometric mean. If the user wants to use another aggregation strategy (or output non-aggregated scores), the following code can be adapted.

import multixrank
multixrank_obj = multixrank.Multixrank(config="airport/config_minimal.yml", wdir="airport")
ranking_df = multixrank_obj.random_walk_rank()
multixrank_obj.write_ranking(ranking_df, path="output_airport", aggregation = "mean")

The example code presented above uses the airport multilayer network described in the Quick start section. This multilayer network is composed of the following networks:

`-- airport
    |-- bipartite
    |   |-- 1_2.tsv
    |   |-- 1_3.tsv
    |   `-- 2_3.tsv
    |-- multiplex
    |   |-- 1
    |   |   |-- FR26.tsv
    |   |   |-- FR3.tsv
    |   |   `-- FR7.tsv
    |   |-- 2
    |   |   |-- UK15.tsv
    |   |   |-- UK26.tsv
    |   |   `-- UK3.tsv
    |   `-- 3
    |       |-- G1.tsv
    |       |-- G24.tsv
    |       `-- G6.tsv