pub enum ClassWeight {
Balanced,
Manual(Vec<(f64, f64)>),
}Expand description
Class weighting strategy for classifiers.
Variants§
Balanced
Weights inversely proportional to class frequencies: n_samples / (n_classes * count_k).
Manual(Vec<(f64, f64)>)
Manual per-class weights. Keys are class labels (as f64), values are weights.
Trait Implementations§
Source§impl Clone for ClassWeight
impl Clone for ClassWeight
Source§fn clone(&self) -> ClassWeight
fn clone(&self) -> ClassWeight
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 ClassWeight
impl Debug for ClassWeight
Source§impl<'de> Deserialize<'de> for ClassWeight
impl<'de> Deserialize<'de> for ClassWeight
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
Source§impl PartialEq for ClassWeight
impl PartialEq for ClassWeight
Source§fn eq(&self, other: &ClassWeight) -> bool
fn eq(&self, other: &ClassWeight) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ClassWeight
impl Serialize for ClassWeight
impl StructuralPartialEq for ClassWeight
Auto Trait Implementations§
impl Freeze for ClassWeight
impl RefUnwindSafe for ClassWeight
impl Send for ClassWeight
impl Sync for ClassWeight
impl Unpin for ClassWeight
impl UnsafeUnpin for ClassWeight
impl UnwindSafe for ClassWeight
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> 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