multiple.ker.score.thresh.cv: Function for RANKS multiple cross-validation and optimal...

View source: R/RANKS.1.1.R

multiple.ker.score.thresh.cvR Documentation

Function for RANKS multiple cross-validation and optimal threshold finding for a single class

Description

Function to execute multiple cross-validation and to find the optimal threshold with RANKS for a single class.

Usage

multiple.ker.score.thresh.cv(K, ind.pos, m = 5, p = 100, 
alpha = seq(from = 0.05, to = 0.6, by = 0.05), 
init.seed = 0, fun = KNN.score, ...)

Arguments

K

matrix. Kernel matrix or any valid symmetric matrix

ind.pos

indices of the positive examples. They are the row indices of RW corresponding to positive examples.

m

number of folds for each cross-validation

p

number of repeated cross-validations

alpha

vector of the quantiles to be tested

init.seed

initial seed for the random generator (def: 0)

fun

function. It must be a kernel-based score method (default KNN.score)

...

optional arguments for the function fun

Details

Function to execute multiple cross-validation with a kernel-based score method and to find the optimal threshold for a given class by internal cross-validation.

Scores are computed by averaging across multiple external cross-validations. The optimal quantile and corresponding threshold are selected by internal cross-validation using a specific metric (def: F-score).

Value

A list with three components:

av.scores

a vector with the average scores across multiple cross-validations. Elements of the vector av.scores correspond to the rows of RW

opt.alpha

the optimal quantile alpha

opt.thresh

the optimal threshold

See Also

ker.score.cv, multiple.ker.score.cv, rw.kernel-methods, Kernel functions.

Examples

# Node label ranking and best threshold search for the DrugBank category Penicillins
# on the Tanimoto chemical structure similarity network (1253 drugs)
# using 5 fold cross-validation repeated 2 times
# and eav-score with 1-step random walk kernel
library(bionetdata);
data(DD.chem.data);
data(DrugBank.Cat);
labels <- DrugBank.Cat[,"Penicillins"];
ind.pos <- which(labels==1);
K <- rw.kernel(DD.chem.data);
res <- multiple.ker.score.thresh.cv (K, ind.pos, m = 5, p = 2, init.seed = 0, fun = KNN.score);

RANKS documentation built on Sept. 21, 2022, 9:06 a.m.