discr.validator: Discriminability Utility Validator

Description Usage Arguments Value

View source: R/validators.R

Description

A script that validates that data inputs are correct, and returns a distance matrix and a ids vector.

Usage

1
2
3
4
5
6
7
8
9
discr.validator(
  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

is interpreted as:

a [n x d] data matrix

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

a [n x n] distance matrix

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

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 as the $D return argument. 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 a [n x n] matrix.

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

whether to remove isolated samples, or samples with only a single instance in the Y vector.

Value

A list containing the following:

DX

The X distance matrix, as a [n x n] matrix.

Y

The sample ids, with isolates removed.


neurodata/r-mgc documentation built on March 12, 2021, 9:45 a.m.