This is an API for a new target encoding implemented in JAVA.

h2o.target_encode_fit(frame, x, y, fold_column = NULL)

Arguments

frame

An H2OFrame object with which to create the target encoding map.

x

List of categorical column names or indices that we want apply target encoding to. Case when item in the list is a list of multiple columns itself is not supported for now.

y

The name or column index of the response variable in the frame.

fold_column

(Optional) The name or column index of the fold column in the frame.

Value

Returns an object containing the target encoding mapping for each column in `x`.

Details

Creates a target encoding map based on group-by columns (`x`) and binary target column (`y`). Computing target encoding for high cardinality categorical columns can improve performance of supervised learning models.

See also

h2o.target_encode_transform for applying the target encoding mapping to a frame.