View source: R/027_pai_bdir_ln.R
pai_bdir_ln | R Documentation |
Introduction of Pairwise bidirectional label noise into a classification dataset.
## Default S3 method: pai_bdir_ln(x, y, level, pairs, order = levels(y), sortid = TRUE, ...) ## S3 method for class 'formula' pai_bdir_ln(formula, data, ...)
x |
a data frame of input attributes. |
y |
a factor vector with the output class of each sample. |
level |
a double in [0,1] with the noise level to be introduced. |
pairs |
a list of integer vectors with the indices of classes to corrupt. |
order |
a character vector indicating the order of the classes (default: |
sortid |
a logical indicating if the indices must be sorted at the output (default: |
... |
other options to pass to the function. |
formula |
a formula with the output class and, at least, one input attribute. |
data |
a data frame in which to interpret the variables in the formula. |
For each vector (c1, c2) in pairs
,
Pairwise bidirectional label noise randomly selects (level
·100)% of the samples
from class c1 in the dataset and (level
·100)% of the samples from class
c2. Then, c1 samples are mislabeled as belonging to c2 and
c2 samples are mislabeled as belonging to c1. The order of the class labels is
determined by order
.
An object of class ndmodel
with elements:
xnoise |
a data frame with the noisy input attributes. |
ynoise |
a factor vector with the noisy output class. |
numnoise |
an integer vector with the amount of noisy samples per class. |
idnoise |
an integer vector list with the indices of noisy samples. |
numclean |
an integer vector with the amount of clean samples per class. |
idclean |
an integer vector list with the indices of clean samples. |
distr |
an integer vector with the samples per class in the original data. |
model |
the full name of the noise introduction model used. |
param |
a list of the argument values. |
call |
the function call. |
Noise model adapted from the papers in References.
S. Fefilatyev, M. Shreve, K. Kramer, L. O. Hall, D. B. Goldgof, R. Kasturi, K. Daly, A. Remsen, and H. Bunke. Label-noise reduction with support vector machines. In Proc. 21st International Conference on Pattern Recognition, pages 3504-3508, 2012. url:https://ieeexplore.ieee.org/document/6460920/.
print.ndmodel
, summary.ndmodel
, plot.ndmodel
# load the dataset data(iris2D) # create new class with some samples class <- as.character(iris2D$Species) class[iris2D$Petal.Length > 6] <- "newclass" iris2D$Species <- as.factor(class) # usage of the default method set.seed(9) outdef <- pai_bdir_ln(x = iris2D[,-ncol(iris2D)], y = iris2D[,ncol(iris2D)], level = 0.1, pairs = list(c(1,2), c(3,4)), order = c("virginica", "setosa", "newclass", "versicolor")) # show results summary(outdef, showid = TRUE) plot(outdef) # usage of the method for class formula set.seed(9) outfrm <- pai_bdir_ln(formula = Species ~ ., data = iris2D, level = 0.1, pairs = list(c(1,2), c(3,4)), order = c("virginica", "setosa", "newclass", "versicolor")) # check the match of noisy indices identical(outdef$idnoise, outfrm$idnoise)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.