Learn R Programming

lolR (version 2.1)

lol.utils.ohe: A function for one-hot encoding categorical respose vectors.

Description

A function for one-hot encoding categorical respose vectors.

Usage

lol.utils.ohe(Y)

Arguments

Y

[n] a vector of the categorical resposes, with K unique categories.

Value

a list containing the following:

Yh

[n, K] the one-hot encoded Y respose variable.

ylabs

[K] a vector of the y names corresponding to each response column.