Skip to content

Weighting

phamongi edited this page Aug 9, 2024 · 14 revisions

Every concept and their ancestors are weighted. The weights can be given in the abundances and ref_abundances parameters.

If no weights are given as input parameter, all input concepts will be weighted by default to 1 (input weight).

All the ancestors retreived not given as input are weighted to 0 (input weight).

The weights are cumulative, each weight of a concept is equal to the sum of the weights of its uniques initially weighted children (calculated weight).

Case 1 : Simple case


Input

  • A has as parents C
  • A has as input weight 3
  • B has as parents C
  • B has as input weight 2

Finality

  • Then C has as calculated weight 3+2=5

Case 2 : Multiple weights


Input

  • A has as parents C
  • A has as input weight 3
  • B has as parents C
  • B has as input weight 2
  • C has as input weight 1

Finality

  • Then C has as calculated weight 3+2+1=6

Case 3 : Duplicated children


Input

  • A has as parents C
  • A has as input weight 3
  • B has as parents C
  • B has as input weight 2
  • A- has as parents A
  • A- has as parents C
  • A- has as input weight 1

Finality

  • Then A has as calculated weight 3+1=4
  • Then C has as calculated weight 3+2+1=6 (A- counted only once)

image

Sectors size

The calculated weight is used to calculate the sectors size (and the colorization for topology analysis).

Sectors size are proportions calculated in 2 different ways. For a given concept sector :

  1. If the sum of the sectors children proportions <= sector proportion :
    • Then sector's children proportions are unchanged
  2. Else :
    • Then sector's children proportions are recalculated so that the sum of their proportion is equal to sector's proportion.

Case 1 : strict inferiority


Input

  • A has as parents C
  • A has as proportion 0.3
  • B has as parents C
  • B has as proportion 0.2
  • C has as proportion 0.6

Finality

  • 0.2+0.3 < 0.6
  • Then C has as size 0.6
  • Then A has as size 0.3
  • Then B has as size 0.2

Case 2 : Equality


Input

  • A has as parents C
  • A has as proportion 0.3
  • B has as parents C
  • B has as proportion 0.2
  • C has as proportion 0.5

Finality

  • 0.2+0.3 = 0.5
  • Then C has as size 0.5
  • Then A has as size 0.3
  • Then B has as size 0.2

Case 3 : strict superiority


Input

  • A has as parents C
  • A has as proportion 0.75
  • B has as parents C
  • B has as proportion 0.25
  • C has as proportion 0.8

Finality

  • 0.75+0.25 > 0.8
  • Then C has as size 0.8
  • Then A has as size 0.6 : ${0.75 \over {0.75+0.25}} \times 0.8$
  • Then B has as size 0.2 : ${0.25 \over {0.75+0.25}} \times 0.8$

Consequences

The re-calculation can cause visual delusions on the figure. Per exemple if the root R (proportion 1) has 3 children : A, B and C with each a proportion of 0.5, the figure will show three sectors under the root with a ratio at 33.3% (instead of 50%).

In this case the colorization in topology analysis can help to compare sectors proportions.

This situation can happen in cases where the ontology has concepts with more than 1 parent.