gpav.holdout: GPAV holdout

Description Usage Arguments Value Examples

View source: R/gpav.R

Description

Correct the computed scores in a hierarchy according to the GPAV algorithm by applying a classical holdout procedure.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gpav.holdout(
  S,
  g,
  testIndex,
  W = NULL,
  parallel = FALSE,
  ncores = 1,
  norm = TRUE,
  norm.type = NULL
)

Arguments

S

a named flat scores matrix with examples on rows and classes on columns (root node included).

g

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

testIndex

a vector of integer numbers corresponding to the indexes of the elements (rows) of the scores matrix S to be used in the test set.

W

vector of weight relative to a single example. If W=NULL (def.) it is assumed that W is a unitary vector of the same length of the columns' number of the matrix S (root node included).

parallel

a boolean value. Should the parallel version GPAV be run?

  • TRUE: execute the parallel implementation of GPAV (gpav.parallel);

  • FALSE (def.): execute the sequential implementation of GPAV (gpav.over.examples);

ncores

number of cores to use for parallel execution. Set ncores=1 if parallel=FALSE, otherwise set ncores to the desired number of cores.

norm

a boolean value. Should the flat score matrix be normalized? By default norm=FALSE. If norm=TRUE the matrix S is normalized according to the normalization type selected in norm.type.

norm.type

a string character. It can be one of the following values:

  1. NULL (def.): none normalization is applied (norm=FALSE)

  2. maxnorm: each score is divided for the maximum value of each class;

  3. qnorm: quantile normalization. preprocessCore package is used;

Value

A named matrix with the scores of the classes corrected according to the GPAV algorithm. Rows of the matrix are shrunk to testIndex.

Examples

1
2
3
4
data(graph);
data(scores);
data(test.index);
S.gpav <- gpav.holdout(S, g, testIndex=test.index, norm=FALSE, norm.type=NULL);

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