pub struct AdditiveChi2Sampler {
pub sample_steps: usize,
pub sample_interval: Float,
}Expand description
Additive Chi-Squared Kernel Approximation
Approximates the additive chi-squared kernel: K(x,y) = Σᵢ (2xᵢyᵢ)/(xᵢ+yᵢ) Used with histogram data in computer vision. This is a stateless transformer.
§Parameters
sample_steps- Number of sampling points (default: 2)sample_interval- Sampling interval (auto-computed if None)
§Examples
ⓘ
use sklears_kernel_approximation::AdditiveChi2Sampler;
use sklears_core::traits::Transform;
use scirs2_core::ndarray::array;
let X = array![[1.0, 2.0], [3.0, 4.0]];
let chi2 = AdditiveChi2Sampler::new(2);
let X_transformed = chi2.transform(&X).unwrap();
assert_eq!(X_transformed.shape(), &[2, 6]); // 2 features * 3 = 6AdditiveChi2Sampler
Fields§
§sample_steps: usizeNumber of sampling points
sample_interval: FloatSampling interval
Implementations§
Trait Implementations§
Source§impl Clone for AdditiveChi2Sampler
impl Clone for AdditiveChi2Sampler
Source§fn clone(&self) -> AdditiveChi2Sampler
fn clone(&self) -> AdditiveChi2Sampler
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 AdditiveChi2Sampler
impl Debug for AdditiveChi2Sampler
Auto Trait Implementations§
impl Freeze for AdditiveChi2Sampler
impl RefUnwindSafe for AdditiveChi2Sampler
impl Send for AdditiveChi2Sampler
impl Sync for AdditiveChi2Sampler
impl Unpin for AdditiveChi2Sampler
impl UnwindSafe for AdditiveChi2Sampler
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