Nearest shrunken centroid through internal cross validation
pam.intcv.Rd
Build a PAM classifier using internal cross validation to choose the tuning parameter, with 5-fold cross validation as the default.
Arguments
- X
dataset to be trained. This dataset must have rows as probes and columns as samples.
- y
a vector of sample group of each sample for the dataset to be trained. It must have an equal length to the number of samples in
X
.- vt.k
custom-specified threshold list. By default,
vt.k = NULL
and 30 values will be predetermined by the pamr package.- n.k
number of threshold values desired. By default,
n.k = 30
.- kfold
number of folds. By default,
kfold = 5
.- folds
pre-specifies samples to each fold. By default,
folds = NULL
for no pre-specification.- seed
an integer used to initialize a pseudorandom number generator.
Value
a list of 4 elements:
- mc
an internal misclassification error rate
- time
processing time of performing internal validation with PAM
- model
a PAM classifier, resulted from
pamr.train
- cfs
estimated coefficients for the final classifier
References
T. Hastie, R. Tibshirani, Balasubramanian Narasimhan and Gil Chu (2014). pamr: Pam: prediction analysis for microarrays. R package version 1.55. https://CRAN.R-project.org/package=pamr
Examples
set.seed(101)
biological.effect <- estimate.biological.effect(uhdata = uhdata.pl)
ctrl.genes <- unique(rownames(uhdata.pl))[grep("NC", unique(rownames(uhdata.pl)))]
biological.effect.nc <- biological.effect[!rownames(biological.effect) %in% ctrl.genes, ]
group.id <- substr(colnames(biological.effect.nc), 7, 7)
biological.effect.train.ind <- colnames(biological.effect.nc)[c(sample(which(group.id == "E"), size = 64),
sample(which(group.id == "V"), size = 64))]
biological.effect.nc.tr <- biological.effect.nc[, biological.effect.train.ind]
pam.int <- pam.intcv(X = biological.effect.nc.tr,
y = substr(colnames(biological.effect.nc.tr), 7, 7),
kfold = 5, seed = 1)
#> 12345678910111213141516171819202122232425262728293012Fold 1 :123456789101112131415161718192021222324252627282930
#> Fold 2 :123456789101112131415161718192021222324252627282930
#> Fold 3 :123456789101112131415161718192021222324252627282930
#> Fold 4 :123456789101112131415161718192021222324252627282930
#> Fold 5 :123456789101112131415161718192021222324252627282930
#> 1 id E-score V-score
#> [1,] A_25_P00010987 0.2963 -0.2963
#> [2,] A_25_P00010987 0.2384 -0.2384
#> [3,] A_25_P00012126 -0.2247 0.2247
#> [4,] A_25_P00010987 0.2165 -0.2165
#> [5,] A_25_P00010987 0.211 -0.211
#> [6,] A_25_P00012126 -0.2081 0.2081
#> [7,] A_25_P00012126 -0.2077 0.2077
#> [8,] A_25_P00012126 -0.2061 0.2061
#> [9,] A_25_P00010987 0.2018 -0.2018
#> [10,] A_25_P00012126 -0.1937 0.1937
#> [11,] A_25_P00012126 -0.1929 0.1929
#> [12,] A_25_P00012126 -0.1875 0.1875
#> [13,] A_25_P00012126 -0.1859 0.1859
#> [14,] A_25_P00010987 0.181 -0.181
#> [15,] A_25_P00012126 -0.1739 0.1739
#> [16,] A_25_P00010987 0.1707 -0.1707
#> [17,] A_25_P00012126 -0.1664 0.1664
#> [18,] A_25_P00010987 0.1601 -0.1601
#> [19,] A_25_P00014849 -0.1545 0.1545
#> [20,] A_25_P00010987 0.1504 -0.1504
#> [21,] A_25_P00010987 0.1453 -0.1453
#> [22,] A_25_P00014849 -0.1383 0.1383
#> [23,] A_25_P00012150 0.126 -0.126
#> [24,] A_25_P00012150 0.1241 -0.1241
#> [25,] A_25_P00014849 -0.1206 0.1206
#> [26,] A_25_P00014849 -0.1124 0.1124
#> [27,] A_25_P00014849 -0.1105 0.1105
#> [28,] A_25_P00012150 0.1079 -0.1079
#> [29,] A_25_P00014849 -0.1054 0.1054
#> [30,] A_25_P00012150 0.1051 -0.1051
#> [31,] A_25_P00014849 -0.0998 0.0998
#> [32,] A_25_P00012150 0.0988 -0.0988
#> [33,] A_25_P00012150 0.0985 -0.0985
#> [34,] A_25_P00012150 0.0938 -0.0938
#> [35,] A_25_P00014849 -0.0867 0.0867
#> [36,] A_25_P00012150 0.0862 -0.0862
#> [37,] A_25_P00014849 -0.0828 0.0828
#> [38,] A_25_P00012150 0.0767 -0.0767
#> [39,] A_25_P00012150 0.058 -0.058
#> [40,] A_25_P00014849 -0.0575 0.0575
#> [41,] A_25_P00011017 -0.0541 0.0541
#> [42,] A_25_P00011017 -0.0365 0.0365
#> [43,] A_25_P00011017 -0.0361 0.0361
#> [44,] A_25_P00010683 -0.0317 0.0317
#> [45,] A_25_P00012138 0.0263 -0.0263
#> [46,] A_25_P00012697 0.0166 -0.0166
#> [47,] A_25_P00012138 0.0115 -0.0115
#> [48,] A_25_P00010683 -0.0114 0.0114
#> [49,] A_25_P00012138 0.0094 -0.0094
#> [50,] A_25_P00010132 0.0079 -0.0079
#> [51,] A_25_P00015907 -0.0023 0.0023
#> [52,] A_25_P00011017 -0.0017 0.0017
#> [53,] A_25_P00012970 -0.0017 0.0017
#> [54,] A_25_P00010683 -3e-04 3e-04
#>