-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi,
I noticed that the one_hot()
function flips labels when applied to binary factors. Specifically, the function uses contrasts() and then drops one of the two columns in the binary case. This results in "0" being encoded as 1 and "1" as 0, which may be unexpected.
labels <- factor(c(0, 1, 1, 0))
one_hot(labels)
# Output: [1] 1 0 0 1
# Expected: [1] 0 1 1 0
This can lead to inconsistencies if the base model is trained on factor labels and the auditor uses one_hot()
.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels