pub enum Encoder<T>{
Ordinal(HashMap<T, u64>),
OneHot(HashMap<T, Vec<bool>>),
Custom(HashMap<T, u64>),
}Variants§
Implementations§
Source§impl<T> Encoder<T>
impl<T> Encoder<T>
pub fn new(enctype: Option<EncoderType>) -> Encoder<T>
Sourcepub fn fit(&mut self, data: &Vec<T>, config: &Config<T>)
pub fn fit(&mut self, data: &Vec<T>, config: &Config<T>)
Fit label encoder given the type (ordinal, one-hot, custom)
Sourcepub fn inverse_transform(&self, data: &Transform) -> Vec<T>
pub fn inverse_transform(&self, data: &Transform) -> Vec<T>
Transforms labels back to the original data (not necessarily true with custom encoder)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Encoder<T>
impl<T> RefUnwindSafe for Encoder<T>where
T: RefUnwindSafe,
impl<T> Send for Encoder<T>where
T: Send,
impl<T> Sync for Encoder<T>where
T: Sync,
impl<T> Unpin for Encoder<T>where
T: Unpin,
impl<T> UnwindSafe for Encoder<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more