-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptimal_threshold.Rd
More file actions
54 lines (51 loc) · 2.2 KB
/
optimal_threshold.Rd
File metadata and controls
54 lines (51 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calc_one_v_rest_auc.R
\name{optimal_threshold}
\alias{optimal_threshold}
\title{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{
\item{fit}{fitted hidden genome classifier object. Experimental: can be NULL, in which case
\code{fitted_prob} and \code{Ynew} must be provided.}
\item{measure}{prediction assessment measure. Options include "fscore",
"mcc" (Mathews Correlation Coefficient). Can be a vector.}
\item{fitted_prob}{an n_tumor x n_cancer matrix of predicted classification probabilities of
(corresponding to the "true" class labels provided in \code{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 \code{"fit"}). Row names and column names must
be identical to the the tumor/sample names and cancer labels in \code{Ynew} (if supplied) or
as used in the fitted model. If \code{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 \code{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 \code{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 \code{measure}.
}
\description{
Determine optimal one-vs-rest classification
thresholds from fitted hidden genome models using
prediction-based performance measures
}