Skip to content

Commit

Permalink
Docs for onecold (#2134)
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
nathanielvirgo authored Dec 15, 2022
1 parent 40f0a63 commit 4a2dc27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/data/onehot.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ julia> onehot(:c, [:a, :b, :c])
1
```

The inverse is `onecold` (which can take a general probability distribution, as well as just booleans).
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.

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

0 comments on commit 4a2dc27

Please sign in to comment.