Description Usage Arguments Details Value References Examples
Similarity-based filter for removing or repairing label noise from a dataset as a preprocessing step of classification. For more information, see 'Details' and 'References' sections.
1 2 3 4 5 6 |
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 considered. |
kk |
Minimum size for local majority class in order to relabel an instance. |
classColumn |
positive integer indicating the column which contains the (factor of) classes. By default, the last column is considered. |
GE
is a generalization of ENN
that integrates the possibility of 'repairing'
or 'relabeling' instances rather than only 'removing'. For each instance, GE
considers
its k-1
neighbors and the instance itself. If there are at least kk
examples from the same class,
the instance is relabeled with that class (which could be its own). Otherwise, it is removed.
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.
Koplowitz J., Brown T. A. (1981): On the relation of performance to editing in nearest neighbor rules. Pattern Recognition, 13(3), 251-255.
1 2 3 4 5 6 7 8 9 10 11 12 | # Next example is not run in order to save time
## Not run:
data(iris)
out <- GE(iris)
summary(out, explicit = TRUE)
# We check that the process was correct
irisCopy <- iris
irisCopy[out$repIdx,5] <- out$repLab
cleanData <- irisCopy[setdiff(1:nrow(iris),out$remIdx),]
identical(out$cleanData,cleanData)
## End(Not run)
|
Filter GE applied to dataset
Call:
GE(x = iris)
Parameters:
k: 5
kk: 3
Results:
Number of removed instances: 0 (0 %)
Number of repaired instances: 7 (4.666667 %)
Explicit indexes for removed instances:
Explicit indexes for repaired instances:
71 73 84 107 120 134 135
New labels for repaired instances:
virginica virginica virginica versicolor versicolor versicolor versicolor
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.