classTAD: Weighted Trimmed Mean Distance Classification Method

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/classTAD.R

Description

Implementation of the classification technique based on assigning each observation to the group that minimizes the trimmed average distance of the given observation to the deepest points of each group in the learning set, weighted by the depth of these points in their own group.

Usage

1
classTAD(xl,yl,xt,alpha=0)

Arguments

xl

an nxp data matrix containing the observations (samples) from the learning set by rows and the variables (genes) by columns

yl

a vector of length n containing the class each observations in xl belongs to

xt

an mxp data matrix containing the observations (samples) from the test set by rows and the variables (genes) by columns

alpha

an optional value for the proportion of observations that are trimmed out when computing the mean. 0 by default.

Details

This method classifies a given observation x into one of g groups, of sizes n1,...,ng, but taking into account only the m=min{n1,...,ng} deepest elements of each group in the learning set. Additionally, this number can be reduced in a proportion alpha. The distance of x to these m elements is averaged and weighted with the depth of each element with respect to its own group.

Value

pred

the vector of length m containing the predicted class of observations in matrix xt

Author(s)

Sara Lopez-Pintado sl2929@columbia.edu and

Aurora Torrente etorrent@est-econ.uc3m.es

References

Lopez-Pintado, S. et al. (2010). Robust depth-based tools for the analysis of gene expression data. Biostatistics, 11 (2), 254-264.

See Also

classDS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  ## simulated data
  set.seed(0)
  xl <- matrix(rnorm(100),10,10); xl[1:5,]<-xl[1:5,]+1
  yl <- c(rep(0,5),rep(1,5))
  xt <- matrix(rnorm(100),10,10)
  classTAD(xl,yl,xt)
  
  ## real data
  data(prostate)
  prost.x<-prostate[,1:100]
  prost.y<-prostate[,101]
  set.seed(0)
  learning <- sample(50,40,replace=FALSE) 
  yl <- prost.y[learning]   
  xl <- prost.x[learning,]
  training <- c(1:nrow(prost.x))[-learning]
  yt.real <- prost.y[training]
  xt <- prost.x[training,] 
  yt.estimated <- classTAD(xl,yl,xt)
  yt.real==yt.estimated

depthTools documentation built on May 24, 2021, 9:06 a.m.