pub struct AdasynStrategy { /* private fields */ }
Expand description
ADASYN (Adaptive Synthetic Sampling) implementation
ADASYN improves upon SMOTE by focusing synthetic sample generation on minority class examples that are harder to learn, determined by their k-nearest neighbor density distribution.
Implementations§
Source§impl AdasynStrategy
impl AdasynStrategy
Sourcepub fn new(k_neighbors: usize, beta: f64) -> AdasynStrategy
pub fn new(k_neighbors: usize, beta: f64) -> AdasynStrategy
Create a new ADASYN strategy
Sourcepub fn default() -> AdasynStrategy
pub fn default() -> AdasynStrategy
Create with default configuration
Trait Implementations§
Source§impl Clone for AdasynStrategy
impl Clone for AdasynStrategy
Source§fn clone(&self) -> AdasynStrategy
fn clone(&self) -> AdasynStrategy
Returns a duplicate of the value. Read more
1.0.0 · 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 AdasynStrategy
impl Debug for AdasynStrategy
Source§impl ResamplingStrategy for AdasynStrategy
impl ResamplingStrategy for AdasynStrategy
Source§type Output = (ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>)
type Output = (ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>)
Output data type
Source§type Config = AdasynConfig
type Config = AdasynConfig
Configuration type for this strategy
Source§fn resample(
&self,
x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>,
y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>,
config: &<AdasynStrategy as ResamplingStrategy>::Config,
) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>
fn resample( &self, x: ArrayBase<ViewRepr<&f64>, Dim<[usize; 2]>>, y: ArrayBase<ViewRepr<&i32>, Dim<[usize; 1]>>, config: &<AdasynStrategy as ResamplingStrategy>::Config, ) -> Result<(ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>), ResamplingError>
Resample the input data to balance class distribution
Source§fn performance_hints(&self) -> PerformanceHints
fn performance_hints(&self) -> PerformanceHints
Consciousness-aligned performance hints
Auto Trait Implementations§
impl Freeze for AdasynStrategy
impl RefUnwindSafe for AdasynStrategy
impl Send for AdasynStrategy
impl Sync for AdasynStrategy
impl Unpin for AdasynStrategy
impl UnwindSafe for AdasynStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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