This examples show-cases the built-in FacetStatisticsVisualizer
using the
Facets Overview integration. Facets
is an awesome project that helps users visualize large amounts of data in a coherent way.
Here, we are using the Boston Housing Price Regression dataset. We create a simple pipeline that returns two pd.DataFrames, one for the training data and one for the test data. In the post-execution workflow we then plug in the visualization class that visualizes the statistics of these DataFrames for us.
This visualization is produced with the following code:
from zenml.post_execution import get_pipelines
from zenml.integrations.facets.visualizers.facet_statistics_visualizer import (
FacetStatisticsVisualizer,
)
def visualize_statistics():
pipe = get_pipelines()[-1]
importer_outputs = pipe.runs[-1].get_step(step="importer")
FacetStatisticsVisualizer().visualize(importer_outputs)
visualize_statistics()
It produces the following visualization:
If you're really in a hurry and just want to see this example pipeline run without wanting to fiddle around with all the individual installation and configuration steps, just run the following:
zenml example run facets_visualize_statistics
In order to run this example, you need to install and initialize ZenML:
# install CLI
pip install zenml
# install ZenML integrations
zenml integration install tensorflow facets
# pull example
zenml example pull facets_visualize_statistics
cd zenml_examples/facets_visualize_statistics
# Initialize ZenML repo
zenml init
# Start the ZenServer to enable dashboard access
zenml up
Now we're ready. Execute:
python run.py
Alternatively, if you want to run based on the config.yaml you can run with:
zenml pipeline run pipelines/facets_pipeline/facets_pipeline.py -c config.yaml
In order to clean up, delete the remaining ZenML references.
rm -rf zenml_examples