asy_def_ln: Asymmetric default label noise

View source: R/001_asy_def_ln.R

asy_def_lnR Documentation

Asymmetric default label noise

Description

Introduction of Asymmetric default label noise into a classification dataset.

Usage

## Default S3 method:
asy_def_ln(x, y, level, def = 1, order = levels(y), sortid = TRUE, ...)

## S3 method for class 'formula'
asy_def_ln(formula, data, ...)

Arguments

x

a data frame of input attributes.

y

a factor vector with the output class of each sample.

level

a double vector with the noise levels in [0,1] to be introduced into each class.

def

an integer with the index of the default class (default: 1).

order

a character vector indicating the order of the classes (default: levels(y)).

sortid

a logical indicating if the indices must be sorted at the output (default: TRUE).

...

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.

Details

Asymmetric default label noise randomly selects (level[i]·100)% of the samples of each class C[i] in the dataset -the order of the class labels is determined by order. Then, the labels of these samples are replaced by a fixed label (C[def]) within the set of class labels.

Value

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.

Note

Noise model adapted from the papers in References.

References

R. C. Prati, J. Luengo, and F. Herrera. Emerging topics and challenges of learning from noisy data in nonstandard classification: a survey beyond binary class noise. Knowledge and Information Systems, 60(1):63–97, 2019. doi: 10.1007/s10115-018-1244-4.

See Also

sym_nean_ln, print.ndmodel, summary.ndmodel, plot.ndmodel

Examples

# load the dataset
data(iris2D)

# usage of the default method
set.seed(9)
outdef <- asy_def_ln(x = iris2D[,-ncol(iris2D)], y = iris2D[,ncol(iris2D)], 
                     level = c(0.1, 0.2, 0.3), order = c("virginica", "setosa", "versicolor"))

# show results
summary(outdef, showid = TRUE)
plot(outdef)

# usage of the method for class formula
set.seed(9)
outfrm <- asy_def_ln(formula = Species ~ ., data = iris2D, 
                     level = c(0.1, 0.2, 0.3), order = c("virginica", "setosa", "versicolor"))

# check the match of noisy indices
identical(outdef$idnoise, outfrm$idnoise)


noisemodel documentation built on Oct. 17, 2022, 9:05 a.m.