pub struct SparseTable { /* private fields */ }Expand description
Arrow-backed sparse table specialized for binary feature matrices.
This is intentionally specialized to binary data. The sparse path is mainly about avoiding the memory cost of materializing dense one-hot-like matrices.
Implementations§
Source§impl SparseTable
impl SparseTable
pub fn new(x: Vec<Vec<f64>>, y: Vec<f64>) -> Result<Self, DenseTableError>
pub fn with_canaries( x: Vec<Vec<f64>>, y: Vec<f64>, canaries: usize, ) -> Result<Self, DenseTableError>
pub fn with_options( x: Vec<Vec<f64>>, y: Vec<f64>, canaries: usize, numeric_bins: NumericBins, ) -> Result<Self, DenseTableError>
pub fn from_sparse_binary_columns( n_rows: usize, n_features: usize, columns: Vec<Vec<usize>>, y: Vec<f64>, canaries: usize, ) -> Result<Self, DenseTableError>
pub fn from_sparse_binary_columns_with_options( n_rows: usize, n_features: usize, columns: Vec<Vec<usize>>, y: Vec<f64>, canaries: usize, numeric_bins: NumericBins, ) -> Result<Self, DenseTableError>
pub fn n_rows(&self) -> usize
pub fn n_features(&self) -> usize
pub fn canaries(&self) -> usize
pub fn numeric_bin_cap(&self) -> usize
pub fn binned_feature_count(&self) -> usize
pub fn feature_value(&self, feature_index: usize, row_index: usize) -> f64
pub fn is_missing(&self, _feature_index: usize, _row_index: usize) -> bool
pub fn is_binary_feature(&self, _index: usize) -> bool
pub fn binned_value(&self, feature_index: usize, row_index: usize) -> u16
pub fn binned_boolean_value( &self, feature_index: usize, row_index: usize, ) -> Option<bool>
pub fn binned_column_kind(&self, index: usize) -> BinnedColumnKind
pub fn is_canary_binned_feature(&self, index: usize) -> bool
pub fn is_binary_binned_feature(&self, _index: usize) -> bool
pub fn target(&self) -> &Float64Array
Trait Implementations§
Source§impl Clone for SparseTable
impl Clone for SparseTable
Source§fn clone(&self) -> SparseTable
fn clone(&self) -> SparseTable
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 SparseTable
impl Debug for SparseTable
Source§impl TableAccess for SparseTable
impl TableAccess for SparseTable
fn n_rows(&self) -> usize
fn n_features(&self) -> usize
fn canaries(&self) -> usize
fn numeric_bin_cap(&self) -> usize
fn binned_feature_count(&self) -> usize
fn feature_value(&self, feature_index: usize, row_index: usize) -> f64
fn is_missing(&self, feature_index: usize, row_index: usize) -> bool
fn is_binary_feature(&self, index: usize) -> bool
fn binned_value(&self, feature_index: usize, row_index: usize) -> u16
fn binned_boolean_value( &self, feature_index: usize, row_index: usize, ) -> Option<bool>
fn binned_column_kind(&self, index: usize) -> BinnedColumnKind
fn is_binary_binned_feature(&self, index: usize) -> bool
fn target_value(&self, row_index: usize) -> f64
fn is_canary_binned_feature(&self, index: usize) -> bool
Auto Trait Implementations§
impl Freeze for SparseTable
impl RefUnwindSafe for SparseTable
impl Send for SparseTable
impl Sync for SparseTable
impl Unpin for SparseTable
impl UnsafeUnpin for SparseTable
impl UnwindSafe for SparseTable
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