class documentation

class MetricsDataSet(JSONDataSet): (source)

View In Hierarchy

MetricsDataSet saves data to a JSON file using an underlying filesystem (e.g.: local, S3, GCS). It uses native json to handle the JSON file. The MetricsDataSet is part of Kedro Experiment Tracking. The dataset is write-only, it is versioned by default and only takes metrics of numeric values.

Example usage for the YAML API:

cars:
  type: metrics.MetricsDataSet
  filepath: data/09_tracking/cars.json

Example usage for the Python API:

>>> from kedro.extras.datasets.tracking import MetricsDataSet
>>>
>>> data = {'col1': 1, 'col2': 0.23, 'col3': 0.002}
>>>
>>> data_set = MetricsDataSet(filepath="test.json")
>>> data_set.save(data)
Class Variable versioned Undocumented
Method _load Undocumented
Method _save Converts all values in the data from a MetricsDataSet to float to make sure they are numeric values which can be displayed in Kedro Viz and then saves the dataset.

Inherited from JSONDataSet:

Method __init__ Creates a new instance of JSONDataSet pointing to a concrete JSON file on a specific filesystem.
Constant DEFAULT_SAVE_ARGS Undocumented
Method _describe Undocumented
Method _exists Undocumented
Method _invalidate_cache Invalidate underlying filesystem caches.
Method _release Undocumented
Instance Variable _fs Undocumented
Instance Variable _fs_open_args_load Undocumented
Instance Variable _fs_open_args_save Undocumented
Instance Variable _protocol Undocumented
Instance Variable _save_args Undocumented

Inherited from AbstractVersionedDataSet (via JSONDataSet):

Method exists Checks whether a data set's output already exists by calling the provided _exists() method.
Method load Loads data by delegation to the provided load method.
Method resolve_load_version Compute the version the dataset should be loaded with.
Method resolve_save_version Compute the version the dataset should be saved with.
Method save Saves data by delegation to the provided save method.
Method _fetch_latest_load_version Undocumented
Method _fetch_latest_save_version Generate and cache the current save version
Method _get_load_path Undocumented
Method _get_save_path Undocumented
Method _get_versioned_path Undocumented
Instance Variable _exists_function Undocumented
Instance Variable _filepath Undocumented
Instance Variable _glob_function Undocumented
Instance Variable _version Undocumented
Instance Variable _version_cache Undocumented

Inherited from AbstractDataSet (via JSONDataSet, AbstractVersionedDataSet):

Class Method from_config Create a data set instance using the configuration provided.
Method __str__ Undocumented
Method release Release any cached data.
Method _copy Undocumented
Property _logger Undocumented
versioned: bool = (source)

Undocumented

def _load(self) -> NoReturn: (source)
def _save(self, data: Dict[str, float]): (source)

Converts all values in the data from a MetricsDataSet to float to make sure they are numeric values which can be displayed in Kedro Viz and then saves the dataset.