data
instead of a list of dictionaries.
Use LaminarDataset
to create a dataset object. The dataset name should match the name of the dataset in Laminar.
The constructor also takes an optional fetch_size
/fetchSize
parameter, which specifies the number of datapoints to fetch at once.
The default value is 25. We strongly recommend setting this value to a number that is a multiple of the
evaluation batch size for best performance.
LaminarDataset
is an implementation of an abstract class EvaluationDataset
which defines 2 methods besides initialization:
__len__
(size
in JS): Returns the number of datapoints in the dataset.__getitem__
(get
in JS): Returns a single datapoint by index.slice
method to make slicing easier than using __getitem__
directly.
This is inspired by the PyTorch Dataset
class,
and is designed to be used in a similar way.
You can re-use the EvaluationDataset
class to create your own dataset classes, for example, to fetch data from a database or an API.