[!!!] // No description yet //

For reproducible results in parallel computing, set seed with parallel::clusterSetRNGStream(iseed = x)(where x is your seed) (and not with set.seed) as package parallelMap is used for paralellization.

# S3 method for hide_it
print(x, ...)

sp_manyroc_with_cv_by_variable(
  Spectra,
  variables_to_analyze,
  k_folds = 3,
  times = 10,
  seeds = NULL,
  kind = NULL
)

Arguments

x

an object used to select a method.

...

further arguments passed to or from other methods.

Spectra

hyperSpec object, that contains colum ID for spectra blocking, columns with grouping variables as well as spectroscopic information.

variables_to_analyze

(character)
A character vector with names of grouping variables to use in analysis.

k_folds

(positive integer)
The number of folds in k-fold cross-validation.

times

(positive integer)
The number of repetitions in repeated k-fold cross-validation.

seeds

(NULL | integer)
Either a vector of integers of length times to set seed for each repetition of k-fold cross-validation. For more about seeds see set.seed().

Each seed will be passed to cvo_create_folds.()

kind

character or NULL. If kind is a character string, set R's RNG to the kind desired. Use "default" to return to the R default. See ‘Details’ for the interpretation of NULL.

Value

A list with results
[!!!] Description needs more specification.

Details

[!!!] The seeds nust be at least of length 6 and meet other requirements for "L'Ecuyer-CMRG" random number generator.

[!!!] At the moment Seeding section needs revision if it is necessary to use "L'Ecuyer-CMRG" (pseudo)random number generator as set.seed() does not work with parallelMap package. Instead parallel::clusterSetRNGStream(iseed = x) (where x is your seed) should be used with parallelMap to get reproducible results.

See also

Examples

library(manyROC) fluorescence$ID <- 1:nrow(fluorescence) sp_manyroc_with_cv_by_variable( fluorescence[, , 500 ~ 501], c("gr", "class"), k_folds = 3, times = 2)
#> Exporting objects to package env on master for mode: local
#> $n_included #> gr class #> 1 150 150 #> #> $ind_included_rows #> gr class #> 1 TRUE TRUE #> 2 TRUE TRUE #> 3 TRUE TRUE #> 4 TRUE TRUE #> ... ... ... #> 147 TRUE TRUE #> 148 TRUE TRUE #> 149 TRUE TRUE #> 150 TRUE TRUE #> #> #> $cvo #> *** First non-empty element: *** #> --- A cvo object: ---------------------------------------------------- #> indices stratified blocked cv_type k repetitions sample_size #> Train TRUE FALSE Repeated k-fold 3 2 150 #> ---------------------------------------------------------------------- #> #> *** Other elements are not shown *** #> #> #> $results #> grouping set fold compared_groups feature median_neg cutoff #> 1 gr training Rep1_Fold1 A vs. B 1 339 320 #> 2 gr training Rep1_Fold1 A vs. C 1 339 343 #> 3 gr training Rep1_Fold1 B vs. C 1 330 342 #> 4 gr training Rep1_Fold2 A vs. B 1 338 334 #> ... ... ... ... ... ... ... ... #> 213 class test Rep2_Fold3 K vs. S1 2 NA 329 #> 214 class test Rep2_Fold3 l vs. N 2 NA 337 #> 215 class test Rep2_Fold3 l vs. S1 2 NA 342 #> 216 class test Rep2_Fold3 N vs. S1 2 NA 327 #> #> median_pos tp fn fp tn sens spec ppv npv bac youden kappa auc #> 1 330 15 21 6 28 0.42 0.82 0.71 0.57 0.62 0.24 0.24 0.62 #> 2 344 16 13 12 22 0.55 0.65 0.57 0.63 0.60 0.20 0.20 0.50 #> 3 344 16 13 10 26 0.55 0.72 0.62 0.67 0.64 0.27 0.28 0.61 #> 4 332 25 12 17 18 0.68 0.51 0.60 0.60 0.59 0.19 0.19 0.55 #> ... ... ... ... ... ... ... ... ... ... ... ... ... ... #> 213 NA 9 8 6 11 0.53 0.65 0.60 0.58 0.59 0.18 0.18 NA #> 214 NA 4 2 6 4 0.67 0.40 0.40 0.67 0.53 0.07 0.06 NA #> 215 NA 12 5 6 4 0.71 0.40 0.67 0.44 0.55 0.11 0.11 NA #> 216 NA 8 9 3 3 0.47 0.50 0.73 0.25 0.49 -0.03 -0.02 NA #> #> #> $variables_included #> [1] "gr" "class" #> #> $variables_errored #> character(0) #> #> $error_messages #> *** First non-empty element: *** #> NULL #> #> *** Other elements are not shown *** #> #>