optimal_threshold: Determine optimal one-vs-rest classification thresholds from...

optimal_thresholdR Documentation

Determine optimal one-vs-rest classification thresholds from fitted hidden genome models using prediction-based performance measures

Description

Determine optimal one-vs-rest classification thresholds from fitted hidden genome models using prediction-based performance measures

Usage

optimal_threshold(
  fit,
  measure = "fscore",
  fitted_prob = NULL,
  true_labels = NULL,
  ...
)

Arguments

fit

fitted hidden genome classifier object. Experimental: can be NULL, in which case fitted_prob and Ynew must be provided.

measure

prediction assessment measure. Options include "fscore", "mcc" (Mathews Correlation Coefficient). Can be a vector.

fitted_prob

an n_tumor x n_cancer matrix of predicted classification probabilities of (corresponding to the "true" class labels provided in Ynew, if supplied, or the original training Y labels, as stored in the trained model) to use for calculating ROC/PRC AUCs, where n_tumor denotes the number of tumor/sample units, and n_cancer is the number of cancer sites in the fitted hidden genome model (supplied through "fit"). Row names and column names must be identical to the the tumor/sample names and cancer labels in Ynew (if supplied) or as used in the fitted model. If NULL (default) then the fitted probabilities are obtained from the model itself by either extracting pre-validated predictive probabilities (only available for mlogit models), or simply using the fitted model to make predictions on the training set.

Value

If length(measure) == 1 the function returns a named vector with optimal one-vs-rest classification thresholds for all cancer classes in the fitted hidden genome object (fit). The optimal values obtained at the corresponding optimal thresholds are returned as an attribute "optimal_value".

If length(measure) > 1 a named list is returned, with each entry providing the optimal thresholds across all cancer categories (along with the associated optimal measure values as an attribute) corresponding to that measure.


c7rishi/hidgenclassifier documentation built on June 14, 2024, 11:10 a.m.