cascade.meta#
Meta analysis and viewing tools
- class cascade.meta.DiffViewer(path: str)[source]#
-
The dash-based server to view meta-data and compare different snapshots using deep diff.
It can work with Repos or Workspaces
- class cascade.meta.HistoryViewer(container: Union[Workspace, Repo, ModelLine], last_lines: Optional[int] = None, last_models: Optional[int] = None, update_period_sec: int = 3)[source]#
-
The tool which allows user to visualize training history of model versions. Uses shows how metrics of models changed over time and how models with different hyperparameters depend on each other.
- __init__(container: Union[Workspace, Repo, ModelLine], last_lines: Optional[int] = None, last_models: Optional[int] = None, update_period_sec: int = 3) None[source]#
-
- Parameters:
-
-
container (Union[Workspace, Repo, ModelLine]) – Container of models to be viewed
-
last_lines (int, optional) – Constraints the number of lines back from the last one to view
-
last_models (int, optional) – For each line constraints the number of models back from the last one to view
-
update_period_sec (int, default is 3) – Update period in seconds
-
- plot(metric: str, show: bool = False) Any[source]#
-
Plots training history of model versions using plotly.
- serve(metric: Optional[str] = None, **kwargs: Any) None[source]#
-
Runs dash-based server with HistoryViewer, updating plots in real-time.
- Parameters:
-
-
metric – One of the metrics in the repo. May be left None and chosen later in the interface
-
optional – One of the metrics in the repo. May be left None and chosen later in the interface
-
**kwargs – Arguments for app.run_server() for example port or host
-
Note
This feature needs
dashto be installed.
- class cascade.meta.MetaViewer(root: str, filt: Optional[Dict[Any, Any]] = None)[source]#
-
The class to view all metadata in folders and subfolders.
- __getitem__(index: int) List[Dict[Any, Any]][source]#
-
- Returns:
-
meta – Meta object that was read from file
- Return type:
-
Meta
- __init__(root: str, filt: Optional[Dict[Any, Any]] = None) None[source]#
-
- Parameters:
-
-
root (str) – path to the folder containing metadata files
-
filt (Dict, optional) – dictionary that specifies which values that should be present in meta for example to find all models use
filt={'type': 'model'}
-
See also
- class cascade.meta.MetricViewer(repo: Union[Repo, ModelLine], scope: Optional[Union[int, str, slice]] = None)[source]#
-
Interface for viewing metrics in model meta files uses Repo to extract metrics of all models if any. As metrics it uses data from
metricsfield in models’ meta and as parameters it usesparamsfield.- __getitem__(key: Union[int, str, slice])[source]#
-
Sets the scope of the viewer after creation. Basically creates new viewer with another scope.
- __init__(repo: Union[Repo, ModelLine], scope: Optional[Union[int, str, slice]] = None) None[source]#
- get_best_by(metric: str, maximize: bool = True) Model[source]#
-
Loads the best model by the given metric
- Parameters:
- Raises:
-
-
TypeError if metric objects cannot be sorted. If only one model in repo, then –
-
returns it without error since no sorting involved. –
-
- plot_table(show: bool = False)[source]#
-
Uses plotly to graphically show table with metrics and parameters.
- serve(page_size: int = 50, include: Optional[List[str]] = None, exclude: Optional[List[str]] = None, **kwargs: Any) None[source]#
-
Runs dash-based server with interactive table of metrics and parameters
- Parameters:
-
-
page_size (int, optional) – Size of the table in rows on one page
-
include (List[str], optional:) – List of parameters or metrics to be added. Only they will be present along with some default
-
exclude (List[str], optional:) – List of parameters or metrics to be excluded from table
-
**kwargs – Arguments of dash app. Can be ip or port for example
-