Learn R Programming

NoiseFiltersR (version 0.1.0)

DROP: Decremental Reduction Optimization Procedures

Description

Similarity-based filters for removing label noise from a dataset as a preprocessing step of classification. For more information, see 'Details' and 'References' sections.

Usage

"DROP1"(formula, data, ...)
"DROP1"(x, k = 1, classColumn = ncol(x), ...)
"DROP2"(formula, data, ...)
"DROP2"(x, k = 1, classColumn = ncol(x), ...)
"DROP3"(formula, data, ...)
"DROP3"(x, k = 1, classColumn = ncol(x), ...)

Arguments

formula
A formula describing the classification variable and the attributes to be used.
data, x
Data frame containing the tranining dataset to be filtered.
...
Optional parameters to be passed to other methods.
k
Number of nearest neighbors to be used.
classColumn
positive integer indicating the column which contains the (factor of) classes. By default, the last column is considered.

Value

An object of class filter, which is a list with seven components:
  • cleanData is a data frame containing the filtered dataset.
  • remIdx is a vector of integers indicating the indexes for removed instances (i.e. their row number with respect to the original data frame).
  • repIdx is a vector of integers indicating the indexes for repaired/relabelled instances (i.e. their row number with respect to the original data frame).
  • repLab is a factor containing the new labels for repaired instances.
  • parameters is a list containing the argument values.
  • call contains the original call to the filter.
  • extraInf is a character that includes additional interesting information not covered by previous items.

Details

DROP1 goes over the dataset in the provided order, and removes those instances whose removal does not decrease the accuracy of the 1-NN rule in the remaining dataset.

DROP2 introduces two modifications against DROP1. Regarding the order of processing instances, DROP2 starts with those which are furthest from their nearest "enemy" (two instances are said to be "enemies" if they belong to different classes). Moreover, DROP2 removes an instance if its removal does not decrease the accuracy of the 1-NN rule in the original dataset (rather than the remaining dataset as in DROP1).

DROP3 is identical to DROP2, but it includes a preprocessing step to clean the borders between classes. It consists of applying the ENN method: any instance misclassified by its k nearest neighbors is removed.

References

Wilson D. R., Martinez T. R. (2000): Reduction techniques for instance-based learning algorithms. Machine learning, 38(3), 257-286. Wilson D. R., Martinez T. R. (1997, July): Instance pruning techniques. In ICML (Vol. 97, pp. 403-411).

Examples

Run this code
# Next example is not run in order to save time
## Not run: 
# data(iris)
# trainData <- iris[c(1:20,51:70,101:120),]
# out1 <- DROP1(Species~ Petal.Length + Petal.Width, data = trainData)
# summary(out1, explicit = TRUE)
# identical(out1$cleanData, trainData[setdiff(1:nrow(trainData),out1$remIdx),])
# ## End(Not run)

Run the code above in your browser using DataLab