RNN: Reduced Nearest Neighbors

Description Usage Arguments Details Value References See Also Examples

Description

Similarity-based method designed to select the most relevant instances for subsequent classification with a nearest neighbor rule. For more information, see 'Details' and 'References' sections.

Usage

1
2
3
4
5
## S3 method for class 'formula'
RNN(formula, data, ...)

## Default S3 method:
RNN(x, 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.

classColumn

positive integer indicating the column which contains the (factor of) classes. By default, the last column is considered.

Details

RNN is an extension of CNN. The latter provides a 'consistent subset', i.e. it is enough for correctly classifying the rest of instances by means of 1-NN. Then, in the given order, RNN removes instances as long as the remaining do not loss the property of being a 'consistent subset'.

Although RNN is not strictly a class noise filter, it is included here for completeness, since the origins of noise filters are connected with instance selection algorithms.

Value

An object of class filter, which is a list with seven components:

References

Gates G.W. (1972): The Reduced Nearest Neighbour Rule. IEEE Transactions on Information Theory, 18:3 431-433.

See Also

CNN

Examples

1
2
3
4
5
6
7
8
# Next example is not run in order to save time
## Not run: 
data(iris)
out <- RNN(Species~., data = iris)
print(out)
identical(out$cleanData, iris[setdiff(1:nrow(iris),out$remIdx),])

## End(Not run)

Example output

Call:
RNN(formula = Species ~ ., data = iris)

Results:
Number of removed instances: 131 (87.33333 %)
Number of repaired instances: 0 (0 %)
[1] TRUE

NoiseFiltersR documentation built on May 2, 2019, 2:03 a.m.