pub trait Number<V>where
    V: Clone + Eq + Hash,
{ fn new(numberer: Numberer<V>) -> Self; fn len(&self) -> usize; fn number(&self, value: V) -> Option<usize>; fn value(&self, number: usize) -> Option<V>; }
Expand description

Number a categorical variable.

Required Methods§

Construct a numberer for categorical variables.

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.

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.

Get the value corresponding of a number.

Returns Option::None if the number is unknown or a reserved number.

Implementors§