2023-01-14

Kedro Viz

Kedro-Viz

Kedro has a visualization feature called Kedro-Viz. Using Kdero-Viz, you can visually understand the flow of processing in the pipeline.

How to use Kedro-Viz

Assume that you have already installed Kedro and created a Kedro project. Install Kedro Viz with the following command.

$ pip install kedro-viz

Go to the root directory of the Kedro project and execute the following command.

$ kedro viz

After executing the above command, you will be redirected to the browser and the workflow will be visualized at http://127.0.0.1:4141/.

spaceflights example

Let us visualize the workflow of the spaceflights project covered in Kedro tutorial.

Create a project and install the library.

$ pip install kedro
$ kedro new --starter=spaceflights
$ cd spaceflights
$ pip install -r requirements.txt

The spaceflights project already contains Kedro-Viz in src/requirements.txt, so there is no need to install Kedro-Viz.

Running the kedro viz command will visualize the spaceflights workflow at http://127.0.0.1:4141/.

$ kedro viz

Kedro Viz | spaceflights

Visualization with graphs

Kedro-Viz can graph data using Plotly or Matplotlib. Please refer to official documentation for details.

Kedro Viz chart

Options

Various options can be added to Kedro-Viz.

Autoreload

The --autoreload flag will automatically reload Kedro-Viz when Python or YAML files are changed.

$ kedro viz --autoreload

Output JSON

With the --save-file flag and a file name, a JSON file will be output.

$ kedro viz --save-file my_shareable_pipeline.json

The --load-file flag allows you to visualize a JSON file.

$ kedro viz --load-file my_shareable_pipeline.json

Visualize a specific pipeline

You can visualize a specific pipeline by adding the --pipeline flag.

$ kedro viz --pipeline <pipeline name>

References

https://github.com/kedro-org/kedro-viz
https://kedro.readthedocs.io/en/stable/visualisation/kedro-viz_visualisation.html

Ryusei Kakujo

researchgatelinkedingithub

Focusing on data science for mobility

Bench Press 100kg!