one_hot: One-hot encoding (fitted)

View source: R/trans_one_hot.R

one_hotR Documentation

One-hot encoding (fitted)

Description

A daltoolbox::dal_transform() that one-hot encodes the categorical columns (factor, character or logical) of a data frame. It learns the categories at fit() and, at transform(), always produces the same columns: a category absent from a batch becomes a zero column and an unseen category is ignored. Numeric columns are kept unchanged. It is the default first step of the preprocessing of adp_recurrent().

Usage

one_hot()

Value

A one_hot object.

Examples

library(daltoolbox)
oh <- fit(one_hot(), iris)
head(transform(oh, iris))

heimdall documentation built on Dec. 2, 2026, 5:08 p.m.