Learn R Programming

HEMDAG (version 2.1.3)

DESCENS: DESCENS variants

Description

The novelty of DESCENS with respect to TPR-DAG algorithm consists in considering the contribution of all the descendants of each node instead of only that of its children, since with the TPR-DAG algorithm the contribution of the descendants of a given node decays exponentially with their distance from the node itself, thus reducing the impact of the predictions made at the most specific levels of the ontology. On the contrary DESCENS predictions are more influenced by the information embedded in the most specific terms of the taxonomy (e.g. leaf nodes), thus putting more emphasis on the terms that most characterize the gene under study.

Usage

descens.threshold(S, g, root = "00", t = 0.5)

descens.threshold.free(S, g, root = "00")

descens.weighted.threshold.free(S, g, root = "00", w = 0.5)

descens.weighted.threshold(S, g, root = "00", t = 0.5, w = 0.5)

descens.tau(S, g, root = "00", t = 0.5)

Arguments

S

a named flat scores matrix with examples on rows and classes on columns

g

a graph of class graphNEL. It represents the hierarchy of the classes

root

name of the class that it is on the top-level of the hierarchy (def. root="00")

t

threshold for the choice of the positive descendants (def. t=0.5); whereas in the descens.tau variant the parameter t balances the contribution between the positives children of a node \(i\) and that of its positives descendants excluding the positives children

w

weight to balance between the contribution of the node \(i\) and that of its positive descendants

Value

a named matrix with the scores of the classes corrected according to the DESCENS algorithm.

Details

The vanilla DESCENS adopts a per-level bottom-up traversal of the DAG to correct the flat predictions \(\hat{y}_i\): $$ \bar{y}_i := \frac{1}{1 + |\Delta_i|} (\hat{y}_i + \sum_{j \in \Delta_i} \bar{y}_j) $$ where \(\Delta_i\) are the positive descendants of \(i\). Different strategies to select the positive descendants \(\Delta_i\) can be applied:

  1. Threshold-Free strategy: as positive descendants we choose those nodes that achieve a score higher than that of their ancestor node \(i\): $$ \Delta_i := \{ j \in descendats(i) | \bar{y}_j > \hat{y}_i \} $$

  2. Threshold strategy: the positive descendants are selected on the basis of a threshold that can ben selected in two different ways:

    1. for each node a constant threshold \(\bar{t}\) is a priori selected: $$ \phi_i := \{ j \in descendats(i) | \bar{y}_j > \bar{t} \} $$ For instance if the predictions represent probabilities it could be meaningful to a priori select \(\bar{t}=0.5\).

    2. the threshold is selected to maximize some performance metric \(\mathcal{M}\) estimated on the training data, as for instance the F-score or the AUPRC. In other words the threshold is selected to maximize some measure of accuracy of the predictions \(\mathcal{M}(j,t)\) on the training data for the class \(j\) with respect to the threshold \(t\). The corresponding set of positives \(\forall i \in V\) is: $$ \phi_i := \{ j \in descendants(i) | \bar{y}_j > t_j^*, t_j^* = \arg \max_{t} \mathcal{M}(j,t) \} $$ For instance \(t_j^*\) can be selected from a set of \(t \in (0,1)\) through internal cross-validation techniques.

The weighted DESCENS variants can be simply designed by adding a weight \(w \in [0,1]\) to balance the contribution between the prediction of the classifier associated with the node \(i\) and that of its positive descendants: $$ \bar{y}_i := w \hat{y}_i + \frac{(1 - w)}{|\Delta_i|} \sum_{j \in \phi_i} \bar{y}_j $$ The DESCENS-\(\tau\) variants balances the contribution between the positives children of a node \(i\) and that of its positives descendants excluding the children by adding a weight \(\tau \in [0,1]\): $$ \bar{y}_i := \frac{\tau}{ 1 +|\phi_i|} ( \hat{y}_i + \sum_{j \in \phi_i} \bar{y}_j ) + \frac{1-\tau}{1+|\delta_i|} ( \hat{y}_i + \sum_{j\in \delta_i} \bar{y}_j ) $$ where \(\phi_i\) are the positive children of \(i\) and \(\delta_i=\Delta_i \setminus \phi_i\) the descendants of \(i\) without its children. If \(\tau=1\) we consider only the contribution of the positive children of \(i\); if \(\tau=0\) only the descendants that are not children contribute to the score, while for intermediate values of \(\tau\) we can balance the contribution of \(\phi_i\) and \(\delta_i\) positive nodes.

See Also

TPR-DAG

Examples

Run this code
# NOT RUN {
data(graph);
data(scores);
data(labels);
root <- root.node(g);
S.descensTF <- descens.threshold.free(S,g,root);
S.descensT <- descens.threshold(S,g,root,t=0.5);
S.descensW <- descens.weighted.threshold.free(S,g,root,w=0.5);
S.descensWT <- descens.weighted.threshold(S,g,root,w=0.5, t=0.5);
S.descensTAU <- descens.tau(S,g,root, t=0.5);
# }

Run the code above in your browser using DataLab