Skip to main content

CanonicalDataset

Trait CanonicalDataset 

Source
pub trait CanonicalDataset {
    // Required methods
    fn data(&self) -> &ArrowDataset;
    fn num_features(&self) -> usize;
    fn num_classes(&self) -> usize;
    fn feature_names(&self) -> &'static [&'static str];
    fn target_name(&self) -> &'static str;
    fn description(&self) -> &'static str;

    // Provided methods
    fn len(&self) -> usize { ... }
    fn is_empty(&self) -> bool { ... }
}
Expand description

A canonical ML dataset with train/test split support

Required Methods§

Source

fn data(&self) -> &ArrowDataset

Returns the full dataset

Source

fn num_features(&self) -> usize

Returns the number of features (excluding label)

Source

fn num_classes(&self) -> usize

Returns the number of classes (for classification datasets)

Source

fn feature_names(&self) -> &'static [&'static str]

Returns the feature column names

Source

fn target_name(&self) -> &'static str

Returns the label/target column name

Source

fn description(&self) -> &'static str

Returns a description of the dataset

Provided Methods§

Source

fn len(&self) -> usize

Returns the number of samples

Source

fn is_empty(&self) -> bool

Returns true if the dataset is empty

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§