Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Custom CSV Dataset

This example demonstrates two ways to load a CSV dataset and implement the Dataset trait. For this example, we use the diabetes dataset (original source), which contains 442 patient records.

InMemDataset

The custom-csv-dataset example uses InMemDataset::from_csv(path) to read the csv dataset file into a vector (in-memory) of DiabetesPatient records (struct) with the help of serde.

Example Usage

cargo run --example custom-csv-dataset

DataframeDataset (Polars)

The dataframe-dataset example demonstrates using DataframeDataset with Polars as the backend. This approach is well-suited for efficient data manipulation and analysis of larger datasets.

The same diabetes dataset is loaded into a Polars DataFrame, which is then wrapped by DataframeDataset to implement the Dataset trait.

Example Usage

cargo run --example dataframe-dataset --features dataframe