在Kedro中,如何选择管道中的中间数据集?

问题描述

我正在处理管道,并在jupyter笔记本上进行手动测试。

这是我的情况。

我想从中拿起example_trainexample_valid,所以我这样写。

context.pipeline.to_outputs("example_train","example_valid")

并将另一条管道传递到SequencialRunner中,我得到了它们。

example of pipeline

我还想要total_steps,所以我改变了这一行。

context.pipeline.to_outputs("example_train","example_valid","total_steps")

,但是结果不包含exampe_train。 是的,我知道example_train不是这个修改过的管道的输出,因此它不包含。

enter image description here

有没有办法收集这种情况的中间数据集?

解决方法

您可以在catalog.yml的数据目录中定义每个数据集,并定义它们的存储位置。

例如:

example_train:
  type: pandas.CSVDataSet
  filepath: data/02_intermediate/example_train.csv

有关如何使用DataCatalog的更多信息,请参见:https://kedro.readthedocs.io/en/stable/05_data/01_data_catalog.html#using-the-data-catalog-within-kedro-configuration