Compare spectra of each pair of indicated groups at each wavelength.

sp_class_perform(
  sp,
  by = stop("Parameter 'by' is missing."),
  measure = c("auc", "bac", "j", "sesp", "tpr")
)

sp_class_perform_cv(
  sp,
  by = stop("Parameter 'by' is not specified."),
  measure = c("sesp", "j", "tpr")[1],
  cvo = cvo_create_folds(sp, by, seeds),
  seeds = NULL,
  sp_test = NULL
)

print.sp_class_perform_cv(obj)

print.sp_classif_performance(obj)

# S3 method for sp_classif_performance
predict(object, newdata, what = c("values", "performance"), ...)

sp_classification_performance(
  sp,
  by = stop("Parameter 'by' is not specified."),
  measure = c("sesp", "j", "tpr")[1],
  cvo = cvo_create_folds(sp, by, seeds),
  seeds = NULL,
  ...
)

sp_compare_gr_wl(
  sp,
  by = stop("Parameter 'by' is missing."),
  measure = c("auc", "j", "sesp", "tpr"),
  ...
)

class_perform_sp(
  sp,
  by = stop("Parameter 'by' is missing."),
  measure = c("auc", "j", "sesp", "tpr"),
  ...
)

Arguments

sp

hyperSpec object.

by

A vector (factor variable) with indicated groups for each case: either variable name inside the object sp, or a vector of length nrow(sp).

measure

string with measure of classification performance. Currently available options:
"auc" - AUC (default) area under the ROC curve;
"j" - Youden's index;
"bac" - Balanced accuracy (mean of Sensitivity (Se) and Specificity (Sp)).

"sesp" - [DEPRECATED!] The same as "bac";
"tpr" - [DEPRECATED!] The same as "bac";
"kappa" - [SLOW, DO NOT USE IT] Cohen's kappa.

cvo

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

Value

Fields of sp_classif_performance object:

type type of data used ("Training data");

performance - hyperSepc object with performance estimates;

cutoffs - hyperSepc object with estimates of critical values (cut-off points);

means - hyperSepc object with means of each compared group;

means.description - type of those means ("10% trimmed mean (of each group)");

compared_by_var - variable name, that was used for grouping;

measure- measure of performance.


Fields of sp_class_perform_cv object:

data - a hyperSpec object with data used in calculations;

cvo - cross-validation object used for analysis;

train_performance - performance estimates of training datasets for each repetition and fold;

test_performance - performance estimates of testing datasets for each repetition and fold;

cutoffs - estimates of cut-off values for each repetition and fold;

obj - a list of sp_classif_performance objects for each repetition and fold;

Author

Vilmantas Gegzna

Examples