capLargeValues: Convert large/infinite numeric values in a data.frame or...

Description Usage Arguments Value See Also Examples

Description

Convert numeric entries which large/infinite (absolute) values in a data.frame or task. Only numeric/integer columns are affected.

Usage

1
2
capLargeValues(obj, target = character(0L), cols = NULL, threshold = Inf,
  impute = threshold, what = "abs")

Arguments

obj

[data.frame | Task]
Input data.

target

[character]
Name of the column(s) specifying the response. Target columns will not be capped. Default is character(0).

cols

[character]
Which columns to convert. Default is all numeric columns.

threshold

[numeric(1)]
Threshold for capping. Every entry whose absolute value is equal or larger is converted. Default is Inf.

impute

[numeric(1)]
Replacement value for large entries. Large negative entries are converted to -impute. Default is threshold.

what

[character(1)]
What kind of entries are affected? “abs” means abs(x) > threshold, “pos” means abs(x) > threshold && x > 0, “neg” means abs(x) > threshold && x < 0. Default is “abs”.

Value

[data.frame]

See Also

Other eda_and_preprocess: createDummyFeatures, dropFeatures, mergeSmallFactorLevels, normalizeFeatures, removeConstantFeatures, summarizeColumns

Examples

1
capLargeValues(iris, threshold = 5, impute = 5)

shuodata/mlr-master documentation built on May 20, 2019, 3:33 p.m.