[−][src]Trait onehot::OneHot
The trait for one-hot encoding of structs and enums.
Associated Types
type Labels: Iterator<Item = &'static str>
An iterator to the labels of each encoded field.
This iterator has the same size as ONEHOT_LEN
type Encoder: Iterator<Item = bool>
An iterator to the encoded values.
This iterator has the same size as ONEHOT_LEN
Associated Constants
const ONEHOT_LEN: usize
How many booleans in the resulting encoding.
Required methods
fn labels() -> Self::Labels
Get the iterator to the labels.
fn onehot(&self) -> Self::Encoder
One-hot encode.
Implementations on Foreign Types
impl<T: OneHot, '_> OneHot for &'_ T
[src]
const ONEHOT_LEN: usize
[src]
type Labels = T::Labels
type Encoder = T::Encoder
fn labels() -> Self::Labels
[src]
fn onehot(&self) -> Self::Encoder
[src]
impl<T: OneHot, '_> OneHot for &'_ mut T
[src]
const ONEHOT_LEN: usize
[src]
type Labels = T::Labels
type Encoder = T::Encoder
fn labels() -> Self::Labels
[src]
fn onehot(&self) -> Self::Encoder
[src]
impl OneHot for bool
[src]
Booleans are trivially one-hot encoded.