Description Usage Arguments Details Value Author(s) Examples
Generate subset data sets based on class labels. This function allows generation of a selection of pairwise problems and/or multiple class problems. The main objective of this function is to alleviate generation of several variables containing data matrices, class information or validation strategy. Each subset can enter accest
and feat.rank.re
analysis without specifying both class and data matrix. Additionally, each subset can also contain validation parameters so that direct comparison between classifiers and feature ranking technique can be easily done.
1 |
dat |
A data frame or matrix. |
cl |
A factor or vector of class. |
pwise |
The vector or list of class labels to be chosen for binary classification. |
mclass |
The vector or list of class labels to be chosen to be included in a multiple classification task. |
pars |
Partitioning information. |
This function is used to provide the data set for the binary combination of the
class factor. If pwise
is list()
, the binary combination of for all
class labels will be done. If pwise
has one class label, the
comparisons between this one and any other class are done. If pwise
has more than three class lables, enumerate the combinations or permutations
of the elements of pwise
. For details, see examples
below.
A list with components:
nam |
Discrimination task. |
dat |
Subset of the dataset. |
cl |
Class labels. |
pars |
Object of type pars. |
tr.idx |
Object of type trainind. |
lsamp |
Sample ids in the original data matrix. |
David dle@aber.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | data(abr1)
x<-abr1$pos[,110:120]
y<-factor(abr1$fact$day)
## generate data set with all pairwise containing class "1"
dat1 <- dat.sel1(x,y,pwise="1",mclass=NULL)
unlist(lapply(dat1,function(x) x$name))
## generate data set with pairwise between classes "1" and "H"
dat1 <- dat.sel1(x,y,pwise=c("1","H"),mclass=NULL)
unlist(lapply(dat1,function(x) x$name))
## generate data set with pairwise between classes "1", "2", "H"
dat1 <- dat.sel1(x,y,pwise=c("2","1","H"),mclass=NULL)
unlist(lapply(dat1,function(x) x$name))
## generate data set with all pairwises containing "1" and "H"
dat1 <- dat.sel1(x,y,pwise=list("1","H"),mclass=NULL)
unlist(lapply(dat1,function(x) x$name))
## generate data set with 3 classes "1", "2" and "H"
dat1 <- dat.sel1(x,y,pwise=NULL,mclass=c("1","2","H"))
unlist(lapply(dat1,function(x) x$name))
## generate data set with all pairwises containing "1" and "H"
## on which partitioning is a 1*5CV
pars=valipars(sampling = "cv", niter = 1, nreps = 5)
dat1 <- dat.sel1(x,y,pwise=list("1","H"),mclass=NULL, pars=pars)
unlist(lapply(dat1,function(x) x$name))
print(dat1[[1]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.