pub enum SamplingStrategy {
None,
Random {
size: usize,
},
Reservoir {
size: usize,
},
Stratified {
key_columns: Vec<String>,
samples_per_stratum: usize,
},
Progressive {
initial_size: usize,
confidence_level: f64,
max_size: usize,
},
Systematic {
interval: usize,
},
Importance {
weight_threshold: f64,
},
MultiStage {
stages: Vec<SamplingStrategy>,
},
}Variants§
None
No sampling - analyze all data
Random
Simple random sampling with fixed size
Reservoir
Reservoir sampling for streaming data
Stratified
Stratified sampling balanced by categories
Progressive
Progressive sampling - stop when confidence is reached
Systematic
Systematic sampling (every Nth row)
Importance
Importance sampling for anomaly detection
MultiStage
Multi-stage sampling (combination of strategies)
Fields
§
stages: Vec<SamplingStrategy>Implementations§
Source§impl SamplingStrategy
impl SamplingStrategy
Sourcepub fn adaptive(total_rows: Option<usize>, file_size_mb: f64) -> Self
pub fn adaptive(total_rows: Option<usize>, file_size_mb: f64) -> Self
Create adaptive strategy based on data characteristics
Sourcepub fn stratified(key_columns: Vec<String>, samples_per_stratum: usize) -> Self
pub fn stratified(key_columns: Vec<String>, samples_per_stratum: usize) -> Self
Create stratified sampling strategy
Sourcepub fn importance(weight_threshold: f64) -> Self
pub fn importance(weight_threshold: f64) -> Self
Create importance sampling strategy
Sourcepub fn should_include(&self, row_index: usize, total_processed: usize) -> bool
pub fn should_include(&self, row_index: usize, total_processed: usize) -> bool
Check if row should be included in sample
Sourcepub fn should_include_with_state(
&self,
row_index: usize,
total_processed: usize,
state: &mut SamplingState,
row_data: Option<&HashMap<String, String>>,
) -> bool
pub fn should_include_with_state( &self, row_index: usize, total_processed: usize, state: &mut SamplingState, row_data: Option<&HashMap<String, String>>, ) -> bool
Check if row should be included with state tracking
pub fn target_sample_size(&self) -> Option<usize>
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get description of the sampling strategy
Trait Implementations§
Source§impl Clone for SamplingStrategy
impl Clone for SamplingStrategy
Source§fn clone(&self) -> SamplingStrategy
fn clone(&self) -> SamplingStrategy
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 moreAuto Trait Implementations§
impl Freeze for SamplingStrategy
impl RefUnwindSafe for SamplingStrategy
impl Send for SamplingStrategy
impl Sync for SamplingStrategy
impl Unpin for SamplingStrategy
impl UnsafeUnpin for SamplingStrategy
impl UnwindSafe for SamplingStrategy
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