pub struct EntropyNCD {
pub base: usize,
pub correction: f64,
}Expand description
Entropy-based Normalized Compression Distance.
It shows how different two inputs are based on their Entropy.
Fields§
§base: usizeThe base of logarithm for the entropy calculation. Default: 2.
correction: f64A non-negative base value to add to entropy of all inputs, so that the entropy is never zero. It accounts for all real-world compression algorithms having a fixed header with metadata. Default: 1.
Trait Implementations§
Source§impl Algorithm<f64> for EntropyNCD
impl Algorithm<f64> for EntropyNCD
Source§fn for_iter<C, E>(&self, s1: C, s2: C) -> Result<f64>
fn for_iter<C, E>(&self, s1: C, s2: C) -> Result<f64>
Calculate distance/similarity for iterators. Read more
Source§fn for_vec<E>(&self, s1: &[E], s2: &[E]) -> Result<R>
fn for_vec<E>(&self, s1: &[E], s2: &[E]) -> Result<R>
Calculate distance/similarity for vectors. Read more
Source§fn for_str(&self, s1: &str, s2: &str) -> Result<R>
fn for_str(&self, s1: &str, s2: &str) -> Result<R>
Calculate distance/similarity for strings. Read more
Auto Trait Implementations§
impl Freeze for EntropyNCD
impl RefUnwindSafe for EntropyNCD
impl Send for EntropyNCD
impl Sync for EntropyNCD
impl Unpin for EntropyNCD
impl UnwindSafe for EntropyNCD
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