Developing and using visualizers
An image speaks a thousand words.

What is a visualizer?

Sometimes it makes sense in the post-execution workflow to actually visualize step outputs. ZenML has a standard, extensible interface for all visualizers:
class BaseVisualizer:
"""Base class for all ZenML Visualizers."""
@abstractmethod
def visualize(self, object: Any, *args: Any, **kwargs: Any) -> None:
"""Method to visualize objects."""
The object can currently be a StepView, a PipelineRunView , or a PipelineView. (These are all different post-execution objects.)

Examples of visualizations

Lineage with dash

from zenml.repository import Repository
from zenml.integrations.dash.visualizers.pipeline_run_lineage_visualizer import (
PipelineRunLineageVisualizer,
)
repo = Repository()
latest_run = repo.get_pipelines()[-1].runs[-1]
PipelineRunLineageVisualizer().visualize(latest_run)
It produces the following visualization:
Lineage Diagram

Statistics with facets

from zenml.integrations.facets.visualizers.facet_statistics_visualizer import (
FacetStatisticsVisualizer,
)
FacetStatisticsVisualizer().visualize(output)
It produces the following visualization:
Statistics for boston housing dataset

Distributions with whylogs

repo = Repository()
pipe = repo.get_pipelines()[-1]
whylogs_outputs = pipe.runs[-1].get_step(name=step_name)
WhylogsVisualizer().visualize(whylogs_outputs)
It produces the following visualization:
WhyLogs visualization

Drift with evidently

from zenml.integrations.evidently.visualizers import EvidentlyVisualizer
repo = Repository()
pipe = repo.get_pipelines()[-1]
evidently_outputs = pipe.runs[-1].get_step(name="drift_detector")
EvidentlyVisualizer().visualize(evidently_outputs)
It produces the following visualization:
Evidently Drift Detection