DatasetVersions¶
- class verta.dataset.entities.DatasetVersions(conn, conf)¶
list
-like object containingDatasetVersion
s.This class provides functionality for filtering and sorting its contents.
There should not be a need to instantiate this class directly; please use
Dataset.versions
.Examples
versions = dataset.versions.find("tags ~= normalized") version = versions.sort("time_created", descending=True)[0] # most recent
- find(*args)¶
Gets the results from this collection that match input predicates.
A predicate is a string containing a simple boolean expression consisting of:
a dot-delimited property such as
metrics.accuracy
a Python boolean operator such as
>=
a literal value such as
.8
- Parameters:
*args (strs) – Predicates specifying results to get.
- Returns:
The same type of object given in the input.
Examples
runs.find("hyperparameters.hidden_size == 256", "metrics.accuracy >= .8") # <ExperimentRuns containing 3 runs> # alternatively: runs.find(["hyperparameters.hidden_size == 256", "metrics.accuracy >= .8"]) # <ExperimentRuns containing 3 runs>
- set_page_limit(limit)¶
Sets the number of entities to fetch per backend call during iteration.
By default, each call fetches a batch of 100 entities, but lowering this value may be useful for substantially larger responses.
- Parameters:
limit (int) – Number of entities to fetch per call.
Examples
runs = proj.expt_runs runs.set_page_limit(10) for run in runs: # fetches 10 runs per backend call print(run.get_metric("accuracy"))
- sort(key, descending=False)¶
Sorts the results from this collection by key.
A key is a string containing a dot-delimited property such as
metrics.accuracy
.- Parameters:
- Returns:
The same type of object given in the input.
Examples
runs.sort("metrics.accuracy") # <ExperimentRuns containing 3 runs>
- with_dataset(dataset)¶
Returns versions of the specified dataset.
- Parameters:
dataset (
Dataset
or None) – Dataset. IfNone
, returns versions across all datasets.- Returns:
DatasetVersions
– Filtered dataset versions.