to_categorical_invert: Make Categorical Mask

Description Usage Arguments Value

View source: R/1-preprocess.R

Description

This function one-hot encodes an integer vector as a matrix, except that it masks certain outcomes. For example, consider the three outcomes 0, 1, 2 where 2 is masked. The value 0 is coded as 1, 0, 0. The value 1 is coded as 0, 1, 0. The value 2 is coded as .5, .5, 0. This blinds the classifier to the value 2.

Usage

1

Arguments

y

The outcome. An integer vector.

mask

The values to mask. If missing, all values are masked.

Value

A matrix like keras::to_categorical.


tpq/caress documentation built on March 11, 2021, 8:03 p.m.