Remove rows outside feature IQR envelopes
removeOutliersIQR.RdFit a ranger model to rank the predictors by impurity importance, then drop every row that falls outside the interquartile-range envelope of any of the most important numeric ones. The envelopes apply together: a row survives only when it is inside all of them.
Arguments
- .data
Training data containing a numeric response column named
y. The response name is the package's split contract:buildDataset()renames each response toywhen it writes the training splits.- n
Number of top-ranked predictors to inspect. Non-numeric predictors among them are ignored; when none of the
nis numeric the data is returned unchanged.- q
Multiplier of the interquartile range. The envelope of a column runs from its first quartile minus
qtimes its interquartile range to its third quartile plus the same amount, so a largerqkeeps more rows. At the default of 3 an approximately normal column loses no row.
Missing values
The ranger fit runs through caret's formula interface, whose default
na.action is na.fail, so a missing value anywhere in .data stops the
call before any envelope is computed. Resolve missing values before calling.
A missing value in a column being inspected would not by itself remove its
row: this function removes outliers, not incomplete rows.
See also
detectOutliers(), which scores rows instead of removing them and
is the routine buildDataset() applies when outlier removal is enabled.