pub struct FittedOrdinalEncoder { /* private fields */ }Expand description
Fitted OrdinalEncoder — holds per-column vocabularies and mappings.
Implementations§
Source§impl FittedOrdinalEncoder
impl FittedOrdinalEncoder
Sourcepub fn transform(&self, columns: &[Vec<String>]) -> Result<Vec<Vec<usize>>>
pub fn transform(&self, columns: &[Vec<String>]) -> Result<Vec<Vec<usize>>>
Transform string columns into ordinal-encoded integer columns.
Returns a Vec<Vec<usize>> where each inner vec is an encoded column.
Sourcepub fn inverse_transform(
&self,
columns: &[Vec<usize>],
) -> Result<Vec<Vec<String>>>
pub fn inverse_transform( &self, columns: &[Vec<usize>], ) -> Result<Vec<Vec<String>>>
Inverse-transform ordinal-encoded columns back to string columns.
Sourcepub fn vocabulary(&self, column: usize) -> Option<&[String]>
pub fn vocabulary(&self, column: usize) -> Option<&[String]>
Return the vocabulary for a specific column.
Sourcepub fn n_categories(&self) -> Vec<usize>
pub fn n_categories(&self) -> Vec<usize>
Return the number of categories per column.
Trait Implementations§
Source§impl Clone for FittedOrdinalEncoder
impl Clone for FittedOrdinalEncoder
Source§fn clone(&self) -> FittedOrdinalEncoder
fn clone(&self) -> FittedOrdinalEncoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FittedOrdinalEncoder
impl Debug for FittedOrdinalEncoder
Source§impl<'de> Deserialize<'de> for FittedOrdinalEncoder
impl<'de> Deserialize<'de> for FittedOrdinalEncoder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FittedOrdinalEncoder
impl RefUnwindSafe for FittedOrdinalEncoder
impl Send for FittedOrdinalEncoder
impl Sync for FittedOrdinalEncoder
impl Unpin for FittedOrdinalEncoder
impl UnsafeUnpin for FittedOrdinalEncoder
impl UnwindSafe for FittedOrdinalEncoder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more