qai_hub.upload_dataset

upload_dataset(data, name=None)

Upload a dataset that expires in 30 days. A Dataset has an ordered named schema. For example, dict(x=…, y=…) has a different schema than dict(y=…, x=…).

Parameters:
  • data (Union[Mapping[str, List[ndarray]], str]) –

    If data is a dict, ordered string keys defines the dataset schema. Length of the list is the number of samples and must be the same for all features

    If string, it must be an h5 path (str) to a saved dataset.

  • name (str | None) – Optional name of the dataset. If a name is not specified, it is decided either based on the data or the file name.

Returns:

dataset – Returns a dataset object if successful.

Return type:

Dataset

Examples

import qai_hub as hub
import numpy as np

# Define dataset
array = np.reshape(np.array(range(15)), (3, 5)).astype(np.float32)

# Upload dataset
hub.upload_dataset(dict(x=[array]), 'simplenet_dataset')