oa::data::Subset

Zero-copy indexed view returned by Dataset::subset. Used for train/val/test splits, subsampling, and index filtering. get_item(i) forwards to parent.get_item(indices[i]) without copying data. Corresponds to oa::DsSubset.

StRust public API

Declaration

pub struct Subset<'ds> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn indices(&self) -> &[i64]
pub fn parent(&self) -> &dyn Dataset
fn len(&self) -> i64
fn get_item(&self, index: i64) -> Result<Matrix>
fn get_sample(&self, index: i64) -> Result<Sample>
fn is_empty(&self) -> bool
fn subset(&self, indices: Vec<i64>) -> Result<Subset<'_>>where Self: Sized,

Associated Functions

pub fn new(parent: &'ds dyn Dataset, indices: Vec<i64>) -> Result<Self>

Public Method Documentation

pub fn indices( &self ) -> &[i64]
No public source comment is attached to this declaration.
pub fn parent( &self ) -> &dyn Dataset
No public source comment is attached to this declaration.
fn len( &self ) -> i64
No public source comment is attached to this declaration.
fn get_item( &self, index: i64 ) -> Result<Matrix>
No public source comment is attached to this declaration.
fn get_sample( &self, index: i64 ) -> Result<Sample>
No public source comment is attached to this declaration.
fn is_empty( &self ) -> bool
No public source comment is attached to this declaration.
fn subset( &self, indices: Vec<i64> ) -> Result<Subset<'_>>where Self: Sized,
No public source comment is attached to this declaration.
pub fn new( parent: &'ds dyn Dataset, indices: Vec<i64> ) -> Result<Self>
No public source comment is attached to this declaration.