gigl.common.utils.KfpOutputViewers#

class gigl.common.utils.kfp.KfpOutputViewers#

Bases: object

Methods

__init__

To enable component ui visualizations, your component must have an output path called mlpipeline_ui_metadata and export a JSON-serialized dictionary to that path that contains metadata of what visualizations to render.

add_confusion_matrix

write_to_output_viewer_path

__init__() None#

To enable component ui visualizations, your component must have an output path called mlpipeline_ui_metadata and export a JSON-serialized dictionary to that path that contains metadata of what visualizations to render.

Example: component.yaml >>> outputs: >>> - {name: mlpipeline_ui_metadata, type: UI metadata} >>> … >>> command: [ >>> python, -m, some_script.py, >>> –mlpipeline_ui_metadata_path, {outputPath: mlpipeline_ui_metadata},

some_script.py >>> if __name__ == “__main__”: >>> parser = argparse.ArgumentParser() >>> parser.add_argument( … “–mlpipeline_ui_metadata_path”, … type=str, … help=”The file path to output the visualization metadata to”, … ) >>> args = parser.parse_args() >>> outputs = KfpOutputViewers() >>> outputs.add_confusion_matrix( … confusion_matrix=array([[2, 0, 0], [0, 0, 1], [1, 0, 2]]) … ) >>> outputs.write_to_output_viewer_path(args.mlpipeline_ui_metadata_path)

https://www.kubeflow.org/docs/components/pipelines/sdk/output-viewer/

__weakref__#

list of weak references to the object (if defined)