hierarchical.checkers: Hierarchical constraints checker

Description Usage Arguments Value Examples

Description

Check if the true path rule is violated or not. In other words this function checks if the score of a parent or an ancestor node is always larger or equal than that of its children or descendants nodes.

Usage

1
2
3
check.hierarchy.single.sample(y.hier, g, root = "00")

check.hierarchy(S.hier, g, root = "00")

Arguments

y.hier

vector of scores relative to a single example. It must be a named numeric vector (names are functional classes).

g

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

root

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

S.hier

the matrix with the scores of the classes corrected in according to hierarchy. It must be a named matrix: rows are examples and columns are functional classes.

Value

A list of 3 elements:

Examples

1
2
3
4
5
6
7
data(graph);
data(scores);
root <- root.node(g);
S.hier <- htd(S,g,root);
S.hier.single.example <- S.hier[sample(ncol(S.hier),1),];
check.hierarchy.single.sample(S.hier.single.example, g, root=root);
check.hierarchy(S.hier, g, root);

HEMDAG documentation built on Feb. 12, 2021, 5:13 p.m.