Learn R Programming

NoiseFiltersR (version 0.1.0)

C45ensembles: Classical Filters based on C4.5

Description

Ensembled-based filters that use C4.5 classifier to remove label noise from a dataset as a preprocessing step of classification. For more information, see 'Details' and 'References' sections.

Usage

"C45robustFilter"(formula, data, ...)
"C45robustFilter"(x, classColumn = ncol(x), ...)
"C45votingFilter"(formula, data, ...)
"C45votingFilter"(x, nfolds = 10, consensus = FALSE, classColumn = ncol(x), ...)
"C45iteratedVotingFilter"(formula, data, ...)
"C45iteratedVotingFilter"(x, nfolds = 10, consensus = FALSE, 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.
nfolds
Number of folds in which the dataset is split.
consensus
Logical. If TRUE, consensus voting scheme is used. If FALSE, majority voting scheme is applied.

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

Full description of the methods can be looked up in the provided reference. Notice that C4.5 is used as base classifier instead of TILDE, since a standard attribute-value classification framework is considered (instead of the ILP classification approach of the reference).

C45robustFilter builds a C4.5 decision tree from the training data, and then removes those instances misclassfied by this tree. The process is repeated until no instances are removed.

C45votingFilter splits the dataset into nfolds folds, building and testing a C4.5 tree on every combination of nfolds-1 folds. Thus nfolds-1 votes are gathered for each instance. Removal is carried out by majority or consensus voting schemes.

C45iteratedVotingFilter somehow combines the two previous filter, since it iterates C45votingFilter until no more noisy instances are removed.

References

Verbaeten S. (2002, December): Identifying mislabeled training examples in ILP classification problems, in Proc. 12th Belgian-Dutch Conf. Mach. Learn., Utrecht, The Netherlands, pp. 71-78.

Examples

Run this code
# Next example is not run in order to save time
## Not run: 
# data(iris)
# out1 <- C45robustFilter(Species~.-Sepal.Length, iris)
# # We fix a seed since next two functions create partitions of data for the ensemble
# set.seed(1)
# out2 <- C45votingFilter(iris, consensus = TRUE)
# out3 <- C45iteratedVotingFilter(Species~., iris, nfolds = 5)
# print(out1)
# print(out2)
# print(out3)
# identical(out1$cleanData,iris[setdiff(1:nrow(iris),out1$remIdx),])
# identical(out2$cleanData,iris[setdiff(1:nrow(iris),out2$remIdx),])
# identical(out3$cleanData,iris[setdiff(1:nrow(iris),out3$remIdx),])
# ## End(Not run)

Run the code above in your browser using DataLab