Learn R Programming

NoiseFiltersR (version 0.1.0)

HARF: High Agreement Random Forest

Description

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

Usage

"HARF"(formula, data, ...)
"HARF"(x, nfolds = 10, agreementLevel = 0.7, ntrees = 500, 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.
nfolds
Number of folds for the cross voting scheme.
agreementLevel
Real number between 0.5 and 1. An instance is identified as noise when the classification confidences provided by the random forest to the classes that are not the actual class of the instance add up at least agreementLevel. Authors obtain the best performance in (Sluban et al., 2010) when setting it between 0.7 and 0.8.
ntrees
Number of trees for the random forest.
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

Making use of a nfolds-folds cross validation scheme, instances are identified as noise and removed when a random forest provides little confidence for the actual instance's label (namely, less than 1-agreementLevel). The value of agreementLevel allows to tune the precision and recall of the filter, getting the best trade-off when moving between 0.7 and 0.8 (Sluban et al., 2010).

References

Sluban B., Gamberger D., Lavrac N. (2010, August): Advances in Class Noise Detection. In ECAI (pp. 1105-1106).

Examples

Run this code
# Next example is not run in order to save time
## Not run: 
# data(iris)
# # We fix a seed since there exists a random partition for the ensemble
# set.seed(1)
# out <- HARF(Species~., data = iris, ntrees = 100)
# print(out)
# identical(out$cleanData, iris[setdiff(1:nrow(iris),out$remIdx),])
# ## End(Not run)

Run the code above in your browser using DataLab