Skip to content

visualize

Visualize a given search instance, automatically choosing the most appropriate visualization technique to do so.

Parameters:

Name Type Description Default
search Union[Search, str]

The search results (in memory or path to disk file) to be visualized.

required
title Optional[str]

The plot title to use.

None
ignore_keys Union[None, str, Sequence[str]]

Which keys in the params/results should be ignored.

None
save_path Optional[str]

The path where the figure should be saved, or None to display the figure to the screen.

None
verbose bool

Whether to print out the save location.

True
**kwargs

Arguments which can pass through the specific underlying visualizers, like 'groups' for cartesian plotting or 'color_by' for parallel coordinate plots.

{}
Source code in fastestimator/fastestimator/search/visualize/visualize.py
def visualize_search(search: Union[Search, str],
                     title: Optional[str] = None,
                     ignore_keys: Union[None, str, Sequence[str]] = None,
                     save_path: Optional[str] = None,
                     verbose: bool = True,
                     **kwargs) -> None:
    """Visualize a given search instance, automatically choosing the most appropriate visualization technique to do so.

    Args:
        search: The search results (in memory or path to disk file) to be visualized.
        title: The plot title to use.
        ignore_keys: Which keys in the params/results should be ignored.
        save_path: The path where the figure should be saved, or None to display the figure to the screen.
        verbose: Whether to print out the save location.
        **kwargs: Arguments which can pass through the specific underlying visualizers, like 'groups' for cartesian
            plotting or 'color_by' for parallel coordinate plots.
    """
    if isinstance(search, str):
        search = _load_search_file(search)
    data = SearchData(search, ignore_keys=ignore_keys)
    if _cartesian_supports_data(data, throw_on_invalid=False):
        visualize_cartesian(search=search,
                            title=title,
                            ignore_keys=ignore_keys,
                            save_path=save_path,
                            verbose=verbose,
                            groups=kwargs.get("groups", None))
    elif _heatmap_supports_data(data, throw_on_invalid=False):
        visualize_heatmap(search=search, title=title, ignore_keys=ignore_keys, save_path=save_path, verbose=verbose)
    else:
        visualize_parallel_coordinates(search=search,
                                       title=title,
                                       ignore_keys=ignore_keys,
                                       save_path=save_path,
                                       verbose=verbose,
                                       color_by=kwargs.get('color_by', None))