Skip to content

Commit 4a2dc27

Browse files
Docs for onecold (#2134)
* Update onehot.md Describe the behaviour of `onecold` when given a probability distribution as input, since it's not what one would expect. * a better description of `onecold`
1 parent 40f0a63 commit 4a2dc27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/data/onehot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ julia> onehot(:c, [:a, :b, :c])
1818
1
1919
```
2020

21-
The inverse is `onecold` (which can take a general probability distribution, as well as just booleans).
21+
There is also a `onecold` function, which is an inverse of `onehot`. It can also be given an array of numbers instead of booleans, in which case it performs an `argmax`-like operation, returning the label with the highest corresponding weight.
2222

2323
```jldoctest onehot
2424
julia> onecold(ans, [:a, :b, :c])

0 commit comments

Comments
 (0)