Dataset over a CSV file's numeric columns: N named feature columns -> one (1, num_features) Tensor per row, plus one named label column -> one (1,) Tensor. Requires a header row (feature/label columns are resolved by name).
More...
#include <csv_dataset.hpp>
|
| | CsvDataset (const std::string &path, std::vector< std::string > feature_columns, std::string label_column, DeviceBackend *backend) |
| |
| int64_t | size () const override |
| | Number of samples in this dataset.
|
| |
| Sample | get (int64_t index) const override |
| |
| virtual | ~Dataset ()=default |
| |
Dataset over a CSV file's numeric columns: N named feature columns -> one (1, num_features) Tensor per row, plus one named label column -> one (1,) Tensor. Requires a header row (feature/label columns are resolved by name).
◆ CsvDataset()
| pulsatrix::CsvDataset::CsvDataset |
( |
const std::string & |
path, |
|
|
std::vector< std::string > |
feature_columns, |
|
|
std::string |
label_column, |
|
|
DeviceBackend * |
backend |
|
) |
| |
- Parameters
-
| path | CSV file path. |
| feature_columns | Column names to use as features, in order. |
| label_column | Column name to use as the label. |
| backend | Backend to allocate row Tensors through. Not owned. |
- Exceptions
-
| std::runtime_error | if the file can't be loaded (see CsvReader::Load), or a named feature/label column doesn't exist in the header – external boundary: column names are caller-supplied configuration, not internally derived. |
◆ get()
| Sample pulsatrix::CsvDataset::get |
( |
int64_t |
index | ) |
const |
|
overridevirtual |
- Exceptions
-
| std::out_of_range | if index is out of bounds. |
| std::runtime_error | if a feature or label cell fails to parse as a float – external boundary: cell content originates from the file, not internal state. |
Implements pulsatrix::Dataset.
◆ size()
| int64_t pulsatrix::CsvDataset::size |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file: