Classical Filters based on C4.5

Share:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## S3 method for class 'formula'
C45robustFilter(formula, data, ...)

## Default S3 method:
C45robustFilter(x, classColumn = ncol(x), ...)

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

## Default S3 method:
C45votingFilter(x, nfolds = 10, consensus = FALSE,
  classColumn = ncol(x), ...)

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

## Default S3 method:
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.

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.

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.

Note

By means of a message, the number of noisy instances removed is displayed in the console.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)