catto_median: Median encoding

Description Usage Arguments Value Examples

Description

Median encoding

Usage

1
catto_median(train, ..., response, test, verbose = TRUE)

Arguments

train

The training data, in a data.frame or tibble.

...

The columns to be encoded. If none are specified, then all character and factor columns are encoded.

response

The response variable used to calculate medians.

test

The test data, in a data.frame or tibble.

verbose

Should informative messages be printed? Defaults to TRUE.

Value

The encoded dataset in a data.frame or tibble, whichever was input. If a test dataset was provided, a list with names "train" and "test" is returned holding the encoded training and test datasets.

Examples

1
catto_median(iris, response = Sepal.Length)

cattonum documentation built on May 2, 2018, 5:06 p.m.