Base Dataset#

Dataset allows to load data from the different data sources. GordoBaseDataset is an abstract class for all dataset implementations.

class gordo_core.base.DatasetWithProvider[source]#

Bases: GordoBaseDataset

This class have to be used if you want to use GordoBaseDataset with DataProvider

abstract get_data_provider() GordoBaseDataProvider[source]#
abstract classmethod with_data_provider(data_provider: dict[str, Any] | GordoBaseDataProvider | None, args: dict[str, Any], *, back_compatibles: dict[tuple[Optional[str], str], tuple[Optional[str], str]] | None = None)[source]#
class gordo_core.base.GordoBaseDataset[source]#

Bases: object

classmethod from_dict(config: dict[str, Any], *, back_compatibles: dict[tuple[Optional[str], str], tuple[Optional[str], str]] | None = None, default_data_provider: str | None = None) GordoBaseDataset[source]#

Construct the dataset using a config from to_dict()

get_client_data(build_dataset_metadata: dict) Tuple[ndarray | DataFrame | DataArray, ndarray | DataFrame | DataArray][source]#

The version of get_data() used by gordo-client

Parameters:

build_dataset_metadatabuild_metadata.dataset part of the metadata

abstract get_data() Tuple[ndarray | DataFrame | DataArray, ndarray | DataFrame | DataArray][source]#

Return X, y data as numpy or pandas’ dataframes given current state

get_metadata() dict[source]#

Get metadata about the current state of the dataset

to_dict() dict[source]#

Serialize this object into a dict representation, which can be used to initialize a new object using from_dict()

gordo_core.base.create_dataset(dataset_cls: Type[GordoBaseDataset], args: dict[str, Any], *, back_compatibles: dict[tuple[Optional[str], str], tuple[Optional[str], str]] | None = None, default_data_provider: str | None = None) GordoBaseDataset[source]#

Create GordoBaseDataset instance.

Parameters:
gordo_core.base.create_with_provider(dataset_cls: Type[DatasetWithProvider], config: dict[str, Any], *, back_compatibles: dict[tuple[Optional[str], str], tuple[Optional[str], str]] | None = None, default_data_provider: str | None = None)[source]#

Instantiate DatasetWithProvider. Call DatasetWithProvider.with_data_provider() under the hood.

Parameters:
Return type:

DatasetWithProvider instance.

gordo_core.base.import_dataset(location: str, *, back_compatibles: dict[tuple[Optional[str], str], tuple[Optional[str], str]] | None = None)[source]#

Import gordo_core.base.GordoBaseDataset class.

Parameters:
Return type:

Class with gordo_core.base.GordoBaseDataset interface implemented.