pub struct ColumnCorrelations { /* private fields */ }Expand description
Tracks correlations between columns within a table
Implementations§
Source§impl ColumnCorrelations
impl ColumnCorrelations
Sourcepub fn add_correlation(
&mut self,
col1: &str,
col2: &str,
coefficient: CorrelationCoefficient,
)
pub fn add_correlation( &mut self, col1: &str, col2: &str, coefficient: CorrelationCoefficient, )
Add a correlation between two columns
Sourcepub fn add_functional_dep(&mut self, determinant: &str, dependent: &str)
pub fn add_functional_dep(&mut self, determinant: &str, dependent: &str)
Add a functional dependency: determinant -> dependent e.g., add_functional_dep(“zip_code”, “city”)
Sourcepub fn get_correlation(&self, col1: &str, col2: &str) -> CorrelationCoefficient
pub fn get_correlation(&self, col1: &str, col2: &str) -> CorrelationCoefficient
Get correlation between two columns (0.0 if unknown)
Sourcepub fn determines(&self, col1: &str, col2: &str) -> bool
pub fn determines(&self, col1: &str, col2: &str) -> bool
Check if col1 functionally determines col2
Get all columns correlated with the given column
Sourcepub fn combined_selectivity(&self, selectivities: &[(&str, f64)]) -> f64
pub fn combined_selectivity(&self, selectivities: &[(&str, f64)]) -> f64
Sourcepub fn detect_correlations_from_sample(
col1_values: &[Value],
col2_values: &[Value],
) -> Option<CorrelationCoefficient>
pub fn detect_correlations_from_sample( col1_values: &[Value], col2_values: &[Value], ) -> Option<CorrelationCoefficient>
Detect correlations from sample data
This uses Pearson correlation coefficient for numeric columns and Cramér’s V for categorical columns.
Trait Implementations§
Source§impl Clone for ColumnCorrelations
impl Clone for ColumnCorrelations
Source§fn clone(&self) -> ColumnCorrelations
fn clone(&self) -> ColumnCorrelations
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 ColumnCorrelations
impl Debug for ColumnCorrelations
Source§impl Default for ColumnCorrelations
impl Default for ColumnCorrelations
Source§fn default() -> ColumnCorrelations
fn default() -> ColumnCorrelations
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ColumnCorrelations
impl RefUnwindSafe for ColumnCorrelations
impl Send for ColumnCorrelations
impl Sync for ColumnCorrelations
impl Unpin for ColumnCorrelations
impl UnwindSafe for ColumnCorrelations
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