Description Usage Arguments Details Value Author(s) Examples
Generate pairwise data set based on class labels.
1 |
dat |
A data frame or matrix. |
cl |
A factor or vector of class. |
choices |
The vector or list of class labels to be chosen for binary classification. |
This function is used to provide the data set for the binary combination of the
class factor. If choices
is NULL
, the binary combination of for all
class labels will be done. If choices
has one class label, the
comparisons between this one and any other class are done. If choices
has more than three class lables, enumerate the combinations or permutations
of the elements of choices
. For details, see examples
below.
A list with components:
dat |
Pairwise data set. |
cl |
Pairwise class label. |
com |
A matrix of the combinations or permutations of the elements of pairwise vector. |
Wanchang Lin wll@aber.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(iris)
x <- subset(iris, select = -Species)
y <- iris$Species
## generate data set with class "setosa" and "virginica"
(binmat.1 <- dat.sel(x,y,choices=c("setosa","virginica")))
## generate data sets for "setosa" vs other classes. These are:
## "setosa" and "versicolor", "setosa" and "virginica".
(binmat.2 <- dat.sel(x,y,choices=c("setosa")))
## generate data set with combination of each class. These are:
## "setosa" and "versicolor", "setosa" and "virginica",
## "versicolor" and "virginica"
(binmat.3 <- dat.sel(x,y,choices= NULL))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.