Trait syntaxdot_encoders::categorical::Number [−][src]
Number a categorical variable.
Required methods
fn new(numberer: Numberer<V>) -> Self
[src]
Construct a numberer for categorical variables.
fn len(&self) -> usize
[src]
Get the number of possible values in the categorical variable.
This includes reserved numerical representations that do not correspond to values in the categorial variable.
fn number(&self, value: V) -> Option<usize>
[src]
Get the number of a value from a categorical variable.
Mutable implementations of this trait must add the value if it
is unknown and always return Option::Some
.
fn value(&self, number: usize) -> Option<V>
[src]
Get the value corresponding of a number.
Returns Option::None
if the number is unknown or a
reserved number.
Implementors
impl<V> Number<V> for ImmutableNumberer<V> where
V: Clone + Eq + Hash,
[src]
V: Clone + Eq + Hash,
fn new(numberer: Numberer<V>) -> Self
[src]
fn len(&self) -> usize
[src]
fn number(&self, value: V) -> Option<usize>
[src]
fn value(&self, number: usize) -> Option<V>
[src]
impl<V> Number<V> for MutableNumberer<V> where
V: Clone + Eq + Hash,
[src]
V: Clone + Eq + Hash,