A function for computing the discriminability from a distance matrix and a set of associated labels.
discr.stat(
X,
Y,
is.dist = FALSE,
dist.xfm = mgc.distance,
dist.params = list(method = "euclidean"),
dist.return = NULL,
remove.isolates = TRUE
)is interpreted as:
[n x d] data matrixX is a data matrix with n samples in d dimensions, if flag is.dist=FALSE.
[n x n] distance matrixX is a distance matrix. Use flag is.dist=TRUE.
[n] a vector containing the sample ids for our n samples.
a boolean indicating whether your X input is a distance matrix or not. Defaults to FALSE.
if is.dist == FALSE, a distance function to transform X. If a distance function is passed,
it should accept an [n x d] matrix of n samples in d dimensions and return a [n x n] distance matrix,
which can be either the default output, an item castable to a distance matrix, or . See mgc.distance for details.
a list of trailing arguments to pass to the distance function specified in dist.xfm.
Defaults to list(method='euclidean').
the return argument for the specified dist.xfm containing the distance matrix. Defaults to FALSE.
is.null(dist.return)use the return argument directly from dist.xfm as the distance matrix. Should be an object castable to a [n x n] matrix.
You can verify whether this is the case by looking at as.matrix(do.call(dist.xfm, list(X, <trailing_args>))
is.character(dist.return) | is.integer(dist.return)use dist.xfm[[dist.return]] as the distance matrix. Should be a [n x n] matrix.
remove isolated samples from the dataset. Isolated samples are samples with only
one instance of their class appearing in the Y vector. Defaults to TRUE.
A list containing the following:
discrthe discriminability statistic.
rdfthe rdfs for each sample.
For more details see the help vignette:
vignette("discriminability", package = "mgc")
Eric W. Bridgeford, et al. "Optimal Decisions for Reference Pipelines and Datasets: Applications in Connectomics." Bioarxiv (2019).
# NOT RUN {
sim <- discr.sims.linear(100, 10, K=2)
X <- sim$X; Y <- sim$Y
discr.stat(X, Y)$discr
# }
Run the code above in your browser using DataLab