pub enum Smooth<F> {
Auto,
Fixed(F),
}Expand description
The smoothing strategy for TargetEncoder.
Mirrors scikit-learn’s smooth parameter
(sklearn/preprocessing/_target_encoder.py:189,
"smooth": [StrOptions({"auto"}), Interval(Real, 0, None, closed="left")]),
whose DEFAULT is the string "auto" (an empirical-Bayes estimate,
_target_encoder.py:85-89) rather than a fixed numeric value.
Variants§
Auto
smooth="auto" — the empirical-Bayes shrinkage estimate
(_target_encoder_fast.pyx:140-165): per category blend the category
mean toward the global mean by a lambda_ derived from the
within-category sum-of-squared deviations vs the overall target variance.
Fixed(F)
A fixed numeric smoothing factor m driving the m-estimate
(smooth * y_mean + Σyᵢ) / (smooth + count)
(_target_encoder_fast.pyx:60-75). Must be non-negative.
Trait Implementations§
impl<F: Copy> Copy for Smooth<F>
impl<F> StructuralPartialEq for Smooth<F>
Auto Trait Implementations§
impl<F> Freeze for Smooth<F>where
F: Freeze,
impl<F> RefUnwindSafe for Smooth<F>where
F: RefUnwindSafe,
impl<F> Send for Smooth<F>where
F: Send,
impl<F> Sync for Smooth<F>where
F: Sync,
impl<F> Unpin for Smooth<F>where
F: Unpin,
impl<F> UnsafeUnpin for Smooth<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Smooth<F>where
F: UnwindSafe,
Blanket Implementations§
impl<T> Boilerplate for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.