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.
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.
cargo run --example custom-csv-datasetThe 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.
cargo run --example dataframe-dataset --features dataframe