discr.stat: Discriminability Statistic

Description Usage Arguments Value Details Author(s) References Examples

View source: R/discrStat.R

Description

A function for computing the discriminability from a distance matrix and a set of associated labels.

Usage

1
2
3
4
5
6
7
8
9
discr.stat(
  X,
  Y,
  is.dist = FALSE,
  dist.xfm = mgc.distance,
  dist.params = list(method = "euclidean"),
  dist.return = NULL,
  remove.isolates = TRUE
)

Arguments

X

is interpreted as:

a [n x d] data matrix

X is a data matrix with n samples in d dimensions, if flag is.dist=FALSE.

a [n x n] distance matrix

X is a distance matrix. Use flag is.dist=TRUE.

Y

[n] a vector containing the sample ids for our n samples.

is.dist

a boolean indicating whether your X input is a distance matrix or not. Defaults to FALSE.

dist.xfm

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.

dist.params

a list of trailing arguments to pass to the distance function specified in dist.xfm. Defaults to list(method='euclidean').

dist.return

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.isolates

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.

Value

A list containing the following:

discr

the discriminability statistic.

rdf

the rdfs for each sample.

Details

For more details see the help vignette: vignette("discriminability", package = "mgc")

Author(s)

Eric Bridgeford

References

Eric W. Bridgeford, et al. "Optimal Decisions for Reference Pipelines and Datasets: Applications in Connectomics." Bioarxiv (2019).

Examples

1
2
3
sim <- discr.sims.linear(100, 10, K=2)
X <- sim$X; Y <- sim$Y
discr.stat(X, Y)$discr

mgc documentation built on July 1, 2020, 7:09 p.m.