roc_manyroc_cv: Carry out the manyROC analysis with cross-validation

Description Usage Arguments Value Author(s) Examples

View source: R/roc_manyroc_cv.R

Description

Do the ROC analysis (roc_analysis) with cross-validation for each column of x (see also: roc_manyroc).

Usage

1
2
roc_manyroc_cv(x, gr, optimize_by = "bac", cvo = cvo_create_folds(x,
  gr, seeds = seeds, kind = kind), seeds = NA_real_, kind = NULL)

Arguments

x

A numeric matrix, a data frame, a hyperSpec object or another type of object, convertible to a numeric matrix.

gr

Either a string (scalar, character(1)) or a factor variable (a vector) which defines groups in x.

optimize_by

(string(1))
A string with the name of classification performance measure to use. Currently available options:

  • "bac" - for balanced accuracy (mean of sensitivity and specificity);

  • "kappa" - for Cohens kappa;

  • "youden" - for Youden's index;

cvo

a cross-validation object (cvo), created with function cvo_create_folds, caret createFolds or similar.

seeds

(NA_real_ | NULL | vector of integers)
Seeds for random number generator for each repetition.

  • If seeds = NA_real_ (default), no seeds are set, parameter kind is also ignored.

  • If seeds = NULL random seeds are generated automatically and registered in attribute "seeds".

  • If numeric vector, then these seeds will be used for each repetition of cross-validation. If the number of repetitions is greater than the number of provided seeds, additional seeds are generated and added to the vector. The first seed will be used to ensure reproducibility of the randomly generated seeds.

For more information about random number generation see set.seed.

kind

(NULL | character)
The kind of (pseudo)random number generator. Default is NULL, which selects the currently-used generator (including that used in the previous session if the workspace has been restored): if no generator has been used it selects "default".

Generator "L'Ecuyer-CMRG" is recommended if package parallel is used for for parallel computing. In this case each seed should have 6 elements neither the first three nor the last three should be all zero. More information at set.seed.

Value

A data frame with results. The object also inferits from class manyroc_cv (for displaying purposes).

Author(s)

Vilmantas Gegzna

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(manyROC)


# --- For numeric vectors objects ---

data(PlantGrowth)

set.seed(123456)

roc_manyroc_cv(PlantGrowth$weight, PlantGrowth$group)

roc_manyroc_cv(PlantGrowth$weight, gl(2, 1, 30))

GegznaV/multiROC documentation built on Sept. 24, 2018, 8:17 p.m.