Description Usage Arguments Value
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.
1 | to_categorical_invert(y, mask = unique(y))
|
y |
The outcome. An integer vector. |
mask |
The values to mask. If missing, all values are masked. |
A matrix like keras::to_categorical
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.